Read handshake status from public API instead of parsing library error strings
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 74/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- networking
调研方向
Read handshakeStatus in src/websocket/utils.ts and trace the SSE path through SseConnection.createErrorEvent in src/websocket/sseConnection.ts; first run test/unit/websocket/utils.test.ts to understand the existing coverage. Check how the public event data reaches handshakeStatus, then verify that unrecoverable-HTTP handling and the SSE 404 fallback still work without relying on error message text.
由索引模型根据 Issue 内容生成。
描述
Background
handshakeStatus (src/websocket/utils.ts) recovers the HTTP status of a failed
WebSocket/SSE handshake by parsing the error message text from two libraries:
ws—Unexpected server response: <code>eventsource—Non-200 status code (<code>)
Neither string is a public contract; both are plain template literals
(ws/lib/websocket.js and eventsource/src/EventSource.ts). If either reword on
a version bump, handshakeStatus returns undefined, every unrecoverable status
becomes a retry-forever connection_error, and CoderApi.is404Error stops
falling back to SSE.
A real-library test (test/unit/websocket/utils.test.ts) now guards against a
silent reword by failing in CI, but parsing internal strings is still fragile.
Proposal
Read the status from the libraries' public event APIs instead of the message:
- SSE:
eventsourceputs the status onErrorEvent.code(documented public
API).SseConnection.createErrorEvent(src/websocket/sseConnection.ts)
currently reads onlymessageanderrorand dropscode; surface it. - WebSocket:
wsexposes the same on itsunexpected-responseevent, which
also suppresses the string path once handled.
Once the status comes from the events, handshakeStatus's string parsing can be
narrowed or removed.
Acceptance
- Handshake status is derived from
ErrorEvent.code/ thews
unexpected-responseevent, not the error message text. - Unrecoverable-HTTP handling and the SSE 404 fallback keep working.
Filed by Coder Agents on behalf of @aqandrew, as a follow-up to PR #1100.
- 主要语言
- TypeScript
- 星标
- 132
- 派生
- 48
- 平均合并
- 2 天 5 小时
- 30 天内合并 PR
- 19
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
coder/vscode-coder 的其他 Issue
-
bug
难度 3/5 1-2 天 新手友好度 72/100
coder/vscode-coder#1141 · 1 条评论 ·
维护者通常 2 天内回复
-
bug tech-debt
难度 3/5 1-2 天 新手友好度 68/100
coder/vscode-coder#1140 · 1 条评论 ·
维护者通常 2 天内回复
-
Improvement tech-debt vs-code
难度 4/5 3-5 天 新手友好度 48/100
coder/vscode-coder#1135 · 1 条评论 ·
维护者通常 2 天内回复
-
Migrate CI setup to pnpm/setup可能已有人在做 @EhabY 于 22 天前认领。 未关闭tech-debt
coder/vscode-coder#1119 · 1 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
Design the VS Code Workspaces panel可能已有人在做 @chrifro 于 25 天前认领。 未关闭
coder/vscode-coder#1113 · 3 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
查看 coder/vscode-coder 的全部 Issue
相似的 Issue
-
chore v2
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/servers#5115 ·
维护者通常 1 天内回复
-
beginner bug good first issue
难度 1/5 1 小时以内 新手友好度 85/100
philaconvalley/website#168 ·
维护者通常 1 天内回复
-
bug frontend good first issue
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
oss-slu/lrda_mobile#294 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
hatchet-dev/hatchet#5179 ·
维护者通常 1 天内回复