partyserver: with hibernation off, a client close without a status code (1005) is never answered, so the client stays in CLOSING
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 69/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- networking
調査の方向性
まず closeQuietly の実装と #394 の変更を読みます。issue では予約済みの close code が特定され、hibernate: false を使った再現手順が示されています。コードなしの close を再現し、6 秒後のソケット状態を確認します。その後、修正後にクライアントが Close フレームを受信し、CLOSING から抜けることを確認します。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 1.3k
- フォーク
- 84
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudflare/partykit のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
cloudflare/partykit#430 ·
-
難易度 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 日以内に返信