Scala Native TLSSocket#applicationProtocol behavior is inconsistent with JVM
维护者通常 3 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- scala
- 领域
- networking
调研方向
Start with the Scala Native TLSSocket#applicationProtocol implementation and compare it with the JVM version, which wraps the possibly null value in an Option and returns the empty string when no protocol is negotiated. The s2n method returning null and the guard call that throws are the points to examine. Pull request #3779 already targets this, so review or test that work rather than starting a parallel fix. Done means Scala Native returns the empty string when no protocol is negotiated, matching the JVM.
由索引模型根据 Issue 内容生成。
描述
Root cause of http4s issue: https://github.com/http4s/http4s/issues/7917
On Scala Native, when there is not applicationProtocol, the s2n method returns null and guard throws.
On JVM, the potentially null string is wrapped in an Option and a NoSuchElementException is thrown instead. When no protocol is negotiated, the result is the empty string.
http4s does not recover from the s2n exception, and IMO should not need to detect it. Instead, Scala Native's behaviour should be consistent with the JVM and return the empty string in this situation.
Prior Art
There is a PR from several years ago to add an option version of applicationProtocol: https://github.com/typelevel/fs2/pull/3215. While the overall API here could be improved, a fix for the Scala Native behavior could have a much smaller scope.
The applicationProtocol behavior also came up in https://github.com/http4s/http4s/pull/7963 where it was observed that FS2 JS also matches the JVM behaviour by turning false into the empty string
- 主要语言
- Scala
- 星标
- 2.5k
- 派生
- 633
- 平均合并
- 3 天 21 小时
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
typelevel/fs2 的其他 Issue
-
Reading from a socket gets stuck on Node.js 26可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 3 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
维护者通常 3 天内回复
-
Feature Proposal: report progress writing to sockets可能已有人在做 @reardonj 于 31 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 45/100
维护者通常 3 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
维护者通常 3 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 3 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 86/100
维护者通常 1 天内回复
-
requires-triage
难度 2/5 1-3 小时 新手友好度 73/100
apache/datafusion-comet#7559 ·
维护者通常 2 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 88/100
propensive/soundness#2438 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
ergoplatform/ergo#2918 ·
维护者通常 2 天内回复
-
Coach photos should fit to coach widget可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
lichess-org/lila#22440 ·
维护者通常 1 天内回复