Read handshake status from public API instead of parsing library error strings
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- networking
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 131
- Fork
- 48
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 16
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của coder/vscode-coder
-
Migrate CI setup to pnpm/setupCó thể đã có người làm @EhabY đã nhận 16 ngày trước. Đang mởtech-debt
coder/vscode-coder#1119 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Design the VS Code Workspaces panelCó thể đã có người làm @chrifro đã nhận 20 ngày trước. Đang mở
coder/vscode-coder#1113 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Flush the connection log buffer after N failed reconnect attempts against an unreachable serverĐang mởenhancement tech-debt
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
coder/vscode-coder#1112 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug upstream
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
coder/vscode-coder#1087 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Improvement tech-debt vs-code
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
coder/vscode-coder#1066 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của coder/vscode-coder
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AOSSIE-Org/DebateAI#611 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Upgrade node-libzim to 4.7.0Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
openzim/mwoffliner#2933 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Use the README category name for website links and submissionsCó thể đã có người làm @dajiaohuang đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
birobirobiro/awesome-shadcn-ui#647 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Twake Drive picker: closePicker() never destroys the intent (stop() is on the promise returned by start(), not by create())Có thể đã có người làm @chibenwa đã nhận hôm nay. Đang mởclaude
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
linagora/twake-calendar-frontend#1498 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Valea Prahovei TV RO SDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày