feat(moqt,relay): Malformed Track検出時に上流subscriptionをUNSUBSCRIBEし、進行中のfetchをFETCH_CANCELする - #327
Merged
Merged
Conversation
yuki-uchida
force-pushed
the
claude/malformed-track-detection
branch
from
August 26, 2026 06:54
d260f9b to
577074b
Compare
yuki-uchida
force-pushed
the
claude/malformed-track-upstream-cleanup
branch
from
August 26, 2026 07:14
bea0fc5 to
3dad3d7
Compare
yuki-uchida
changed the base branch from
master
to
claude/session-event-kind-refactor
August 26, 2026 08:03
yuki-uchida
force-pushed
the
claude/malformed-track-upstream-cleanup
branch
from
August 26, 2026 08:07
579ffe2 to
f459e00
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ormed track Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s detected A per-track watch task reports the sticky malformed latch into the relay event pipeline, where the upstream subscription is unregistered, UNSUBSCRIBE is forwarded upstream (draft-14 2.5 MUST), and ingress is stopped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces the mock Session/Subscriber pairs duplicated across the unsubscribe, malformed-track, and fetch-ingest tests with a single recording mock in core::mocks, per the shared-Arrange testing rule. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
yuki-uchida
force-pushed
the
claude/malformed-track-upstream-cleanup
branch
from
August 26, 2026 08:25
f459e00 to
9427337
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The latch is only ever set inside an append, so the reader or fetch fill that performed the latching append reports the detection itself; the standing per-track watch task and its lifecycle bookkeeping are removed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
概要
PR#323はMalformed Track(draft-14 §2.5)の検出と下流隔離のみで、仕様がMUSTとする上流側クリーンアップが未実装だった。検出したトラックの上流subscriptionをUNSUBSCRIBEし、進行中のfetchをFETCH_CANCELし、ingestを停止する。
関連タスク
#323 のフォローアップ
やったこと
Subscriber::fetch_cancel(request_id)を追加IngressCommand::StopTrackを実行(重複通知は冪等。ラッチはappend内でしか立たないため常駐監視タスクは持たない)sequenceDiagram participant P as 上流Publisher participant I as Ingress(Reader / FetchIngest) participant C as TrackCache participant E as EventHandler I->>C: append(内容違いの重複受信) C-->>I: malformedラッチ(sticky) I->>E: MalformedTrackDetected E->>E: 上流subscriptionをテーブルから削除 E->>P: UNSUBSCRIBE E->>I: StopTrack C-->>I: fetch fill中断 I->>P: FETCH_CANCELやらないこと
subscriber側のPUBLISH_DONE受信処理、§2.5条件1〜7の検出、malformed以外の失敗(fetch fillタイムアウト等)でのFETCH_CANCEL送信
影響範囲
moqt・relay(いずれもAPI追加のみ)。wasm/examplesは変更不要:ブラウザpublisherはFETCHを受理しないためFETCH_CANCEL受信は発生せず、UNSUBSCRIBE受信は既存処理(wasmのalias削除+JSのエンコーダ停止)で送信が止まる
テスト
🤖 Generated with Claude Code