[y-partyserver] Provider sends other clients' awareness back to the server
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- backend
調査の方向性
YProvider の _awarenessUpdateHandler(変更のたびにブロードキャストする awareness 変更ハンドラー)と、provider を origin としてサーバーからの更新を適用する awareness メッセージハンドラーから調べ始めてください。origin が provider の場合は早期 return を追加し、クライアントがサーバーから受け取った更新を再送しないようにします。1 つのタブでカーソルを動かしたときに N 個ではなく 1 フレームだけ送信され、他のタブでリモートカーソルが引き続き描画されれば完了です。サーバー由来の origin の更新をハンドラーがスキップすることを確認するテストがあれば、それを示せます。
索引モデルが issue の本文から書いたものです。
説明
What happens
YProvider's awareness handler sends a message on every awareness change, whatever its origin:
this._awarenessUpdateHandler = ({ added, updated, removed }, _origin) => { /* … */ broadcastMessage(/* … */) };
Awareness updates from the server are applied with the provider as origin (applyAwarenessUpdate(provider.awareness, …, provider) in the awareness message handler), so each client sends every other client's change straight back. YServer already relays every awareness message to all connections, so with N clients one cursor move costs the server N incoming frames instead of 1. On Durable Objects each of them is an invocation: a billed request, and a log event when Workers Logs is on.
Measured
y-partyserver 2.2.0 (the handler is the same on main), 3 Chromium tabs on one document, frames counted by wrapping WebSocket.prototype.send:
| Now | With the fix below | |
|---|---|---|
| Cursor move (arrow key) in one tab | 3 frames | 1 |
| Keystroke, with Tiptap's CollaborationCaret | 10 | 4 (2 with ueberdosis/y-tiptap#55 fixed too) |
Remote cursors still render in every tab with the fix.
Suggested fix
this._awarenessUpdateHandler = ({ added, updated, removed }, origin) => {
if (origin === this) return; // from the server, which has already relayed it to everyone
// …
};
Every client only needs to receive each awareness update once; re-sending is allowed but not needed (Yjs's author on the same y-websocket behaviour: https://discuss.yjs.dev/t/redundant-messages/1062). Happy to open a PR with a test.
- 主要言語
- TypeScript
- スター
- 1.3k
- フォーク
- 84
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudflare/partykit のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
cloudflare/partykit#425 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cloudflare/partykit#423 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cloudflare/partykit#419 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
cloudflare/partykit#411 ·
-
[y-partyserver] provider.destroy() leaks reconnect timer, hanging Node processes and delaying GCオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
cloudflare/partykit#402 · コメント 1 件 ·
cloudflare/partykit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
lichess-org/lila#22324 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Feature Request] [Web] Expose kvCacheQuantizationBits in the onnxruntime-web WebGPU EP optionsオープンep:WebGPU platform:web quantization
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
microsoft/onnxruntime#33752 ·
メンテナーはふだん 2 日以内に返信
-
[Skill Bug]: entra-agent-id: inaccurate blueprint permission inheritance and parent token sub claimオープンbug entra-agent-id
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/GitHub-Copilot-for-Azure#3467 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
fix(worker): keep normal prepare waiting states failure-free対応中かも @LichKing-2234 が今日担当しました。 オープンagent:codex priority:P1
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AgoraIO-Extensions/agent-infra#3745 ·
メンテナーはふだん 1 日以内に返信
-
The five-line work window can drop its oldest line: the per-line byte share ignores the JSON framing対応中かも @Eapp1e が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
makecindy/cindy#7973 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信