fix: WebSocket モードの subNote 購読を再接続時に replay する#27
Merged
Conversation
WebSocket モードの sub_note は WsCommand を送るだけで captured_notes に 記録していなかったため、再接続 (idle watchdog / ネットワークエラー) で サーバー側の subNote 購読が失われたまま二度と復元されず、捕捉中ノートの noteUpdated (リアクション等) がサイレントに止まっていた。 - sub_note / unsub_note は両モード共通で captured_notes を更新する - run_ws_session がチャンネル購読の replay 後に captured_notes からも subNote を再送する - disconnect はアカウントの captured_notes も破棄する (subscriptions と 同じライフサイクル) - 副次効果: realtime→polling のモード切替でも捕捉が引き継がれる
Misskey の subNote は refcount 式で冪等でないため、replay と切断中に queue された SubNote コマンドが二重送信されると、unsubNote 1 回では サーバー側購読が残ってしまう。セッション内で送信済みのノート id を 追跡し、重複送信をスキップする。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
WebSocket モードの
sub_noteはWsCommandを送るだけでcaptured_notesに記録していなかったため、再接続(idle watchdog / ネットワークエラー / ネット断)でサーバー側の subNote 購読が失われたまま二度と復元されず、捕捉中ノートの noteUpdated(リアクション・編集等)がサイレントに止まっていた。notedeck 側 hitalin/notedeck#506 の調査(hitalin/notedeck#640 の二次バグ)で特定されたもの。
変更
sub_note/unsub_noteは WebSocket / polling 両モード共通でcaptured_notesテーブルを更新するrun_ws_sessionがチャンネル購読の replay 後にcaptured_notesからもsubNoteを再送するdisconnectはアカウントのcaptured_notesも破棄する(subscriptions と同じライフサイクル)検証
cargo check/cargo clippy --all-targetsクリーンcargo test169 件全通過[patch]によるローカル統合ビルド確認済み🤖 Generated with Claude Code