partyserver: with hibernation off, a client close without a status code (1005) is never answered, so the client stays in CLOSING
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 69/100
- Loại issue
- Lỗi
- Độ 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
Bắt đầu bằng cách đọc phần triển khai closeQuietly và thay đổi trong #394; issue xác định các mã đóng được dành riêng và đưa ra cách tái hiện bằng hibernate: false. Tái hiện thao tác đóng không có mã và kiểm tra trạng thái socket sau 6 giây, sau đó xác minh rằng sau khi sửa, client nhận được một Close frame và thoát khỏi CLOSING.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Since #394, closeQuietly skips the reply for the reserved codes 1005, 1006 and 1015. 1006 and 1015 mean that no Close frame arrived. 1005 does not: it is what the server reports when the client sent a real Close frame with an empty body, which is what ws.close() with no arguments does. The transport is still open, and the client waits in CLOSING for the server's Close frame.
On a non-hibernating server (static options = { hibernate: false }) that frame never comes. y-partyserver's provider calls ws.close() with no code in disconnect(), so every YProvider.disconnect() ends this way. The provider keeps wsconnected === true until the socket finally dies, and a connect() in the meantime does nothing.
The #394 notes say compatibility dates on or after 2026-04-07 auto-reply to Close frames. That does not happen for these sockets: the result below is on compatibility date 2026-11-01.
Repro (wrangler 4.159.0, workerd 1.20261109.1, partyserver 0.5.10, y-partyserver 2.2.0, compatibility date 2026-11-01, hibernate: false):
- Start a
YServersubclass withhibernate: false(for example viaunstable_startWorker). - Open a raw WebSocket to
/parties/<party>/<room>, wait foropen, then callws.close()with no code. - With the stock
onClose, the client is still in readyState 2 (CLOSING) after 6000 ms. - Add
if (code === 1005) connection.close(1000, 'Closed')toonClose. The close completes in 14 ms and the client sees 1000.
In our production Worker that reply has run on every pause, reload and tab close since 2026-11-09. wrangler tail during a test run (57 events) showed no exceptions and no Network connection lost rejections.
Suggested fix: in closeQuietly, skip the reply only for 1006 and 1015. For 1005, reply with ws.close() (no code) or with 1000. A peer that sent a code-less Close frame is still there to receive the answer.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.3k
- Fork
- 84
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- 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 cloudflare/partykit
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
cloudflare/partykit#430 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
cloudflare/partykit#428 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
cloudflare/partykit#425 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudflare/partykit#424 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudflare/partykit#423 ·
Tất cả issue của cloudflare/partykit
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
mcp: create_app refuses the Assistant Inbox spec as 'looks like an API key' (nesting deeper than 8)Đang mởagent:claude agent:ready dogfood type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
opennextjs/opennextjs-cloudflare#1485 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement lane: fast tier: should-stable
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
unicef/adt-studio#1078 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
WenyuChiou/agent-board#1283 ·
Maintainer thường phản hồi trong vòng 1 ngày