partyserver: with hibernation off, a closing socket removes a newer connection with the same id from getConnections(), so that client stops receiving broadcasts
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
- 82/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
- backend
Hướng nghiên cứu
Bắt đầu với InMemoryConnectionManager.accept và removeConnection, nơi issue xác định mục trong map và listener close/error. Kiểm tra các bài kiểm thử về thay thế kết nối và các sự kiện close bị trì hoãn, sau đó xác minh rằng việc đóng socket cũ vẫn để kết nối mới hơn khả dụng thông qua getConnections(). Hoàn tất khi kết nối thay thế tiếp tục nhận broadcast sau khi socket cũ đóng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
InMemoryConnectionManager.accept stores connections in a Map keyed by connection.id. Its close/error listener runs this.#connections.delete(connection.id) without checking that the entry is still that connection.
y-partyserver's YProvider sends one _pk (from connectionId, or nanoid(10) once per provider) on every reconnect. So a client that reconnects while the server still holds its old socket replaces the map entry. When the old socket's close arrives later, the delete removes the new, live connection. From then on getConnections() never yields it. The client keeps sending and the server keeps applying its updates, but no broadcast reaches it: with y-partyserver that is every document update and every awareness change from the other peers. Nothing tells the client, and the provider has no watchdog for a silent socket, so it stays deaf until it reconnects for some other reason.
Repro (partyserver 0.5.10, y-partyserver 2.2.0, wrangler 4.159.0, compatibility date 2026-11-01, hibernate: false, via unstable_startWorker). A and B are YProviders in one room:
- Open a raw WebSocket to the room with
?_pk=<A.provider.id>. It stands in for an old socket the server has not seen die yet. - Connect A, then terminate the raw socket and wait 1.5 s.
- A's updates still reach B. But within 3 s, none of these reach A: B's updates, B's awareness change, and the updates of a newcomer C.
The result is the same when the raw socket opens after A. Without the raw socket, all of these checks pass.
Suggested fix: in removeConnection, delete only when this.#connections.get(connection.id) === connection. The older socket then leaves the map as soon as it is replaced, which fits: it is the stale one.
- 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 69/100
cloudflare/partykit#429 ·
-
Độ 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