partyserver: with hibernation off, a closing socket removes a newer connection with the same id from getConnections(), so that client stops receiving broadcasts
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- backend
調査の方向性
InMemoryConnectionManager.accept と removeConnection から始めます。issue では map エントリーと close/error リスナーが特定されています。接続の置き換えと遅延した close イベントに関するテストを確認し、古い socket を閉じても新しい接続が getConnections() から引き続き利用できることを検証します。古い socket が閉じた後も置き換え後の接続がブロードキャストを受信し続ければ完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 1.3k
- フォーク
- 84
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudflare/partykit のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
cloudflare/partykit#429 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
cloudflare/partykit#428 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
cloudflare/partykit#425 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cloudflare/partykit#424 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cloudflare/partykit#423 ·
cloudflare/partykit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
mcp: create_app refuses the Assistant Inbox spec as 'looks like an API key' (nesting deeper than 8)オープンagent:claude agent:ready dogfood type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
opennextjs/opennextjs-cloudflare#1485 ·
メンテナーはふだん 1 日以内に返信
-
enhancement lane: fast tier: should-stable
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
unicef/adt-studio#1078 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
WenyuChiou/agent-board#1283 ·
メンテナーはふだん 1 日以内に返信