Repository navigation
fix(spf): leave isComplete out of live MSF catalogs and end broadcasts per §11.3 - #61
Conversation
draft-ietf-moq-msf-01 §5.1.3 makes isComplete an irrevocable commitment that the broadcast is over. buildMsfCatalog stamped it on every catalog, so spec-following players and caches could treat a live broadcast as finished from its first catalog. Refs #60
… stop When a publish session is still serving at teardown (unpublish, endpoint change, engine destroy), end the catalog track with the §11.3 catalog — isComplete with an empty tracks array — after every media track ends. A failed, closed, or GOAWAY-draining session never sends it. To get that last group on the wire during teardown, track publishers gain flushed(), a registered track's end() can hold its subscription FINs until a last object lands, and the session accepts stream opens inside its bounded close drain. Fixes #60
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
📦 Bundle Size Report🎨 @videojs/html — 1 small size change
Presets (7)
Media (20)
Players (6)
Skins (32)
UI Components (73)
⚛️ @videojs/react — 1 small size change
Presets (7)
Media (23)
Extensions (2)
Players (5)
Skins (20)
UI Components (50)
🧩 @videojs/core — no changesEntries (77)
🏷️ @videojs/element — no changesEntries (2)
📦 @videojs/store — no changesEntries (3)
🔧 @videojs/utils — no changesEntries (13)
📦 @videojs/cdn — no changes📦 @videojs/cloudflare-video — no changes📦 @videojs/dash-video — no changes📦 @videojs/google-cast — no changes📦 @videojs/hlsjs-video — no changes📦 @videojs/media — no changesEntries (3)
📦 @videojs/mux — no changes📦 @videojs/mux-audio — no changesEntries (2)
📦 @videojs/mux-data — no changes📦 @videojs/mux-video — no changesEntries (2)
📦 @videojs/native-hls-video — no changes📦 @videojs/shaka-video — no changes📦 @videojs/spf — 2 small size changes
Entries (10)
📦 @videojs/spotify-audio — no changes📦 @videojs/tiktok-video — no changes📦 @videojs/twitch-video — no changes📦 @videojs/other — 1 small size change
Entries (3)
📦 @videojs/vimeo-video — no changes📦 @videojs/wistia-video — no changesEntries (2)
📦 @videojs/youtube-video — no changesℹ️ How to interpretEach entry is independently bundled, minified, and brotli-compressed. Initial size includes its static import graph; lazy dynamic chunks are reported separately. Entries are not additive because their dependency graphs overlap. Preset rows represent realistic combined bundles. Changes of 300 B or less across initial, lazy, and total size are collapsed, not discarded. Run |
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
The previous test let the stream close settle as soon as the write was released, so it still passed if flushed() stopped awaiting the detached FINs. Also document that flushed() observes and closes nothing: a keyframe-grouped track's open group needs an end first.
Fixes #60
Summary
The MSF publisher wrote
isComplete: trueinto every catalog, including those of live broadcasts. draft-ietf-moq-msf-01 §5.1.3 makes that field an irrevocable commitment that the broadcast is over, so a spec-following player or cache could treat a live stream as finished from its first catalog. Live catalogs now leave the field out, and a broadcast stopped on purpose ends with the §11.3 end-of-broadcast catalog instead.Changes
buildMsfCatalognever emitsisCompletefor a live catalog. A newcompleteinput builds the §11.3 catalog:isComplete: truewith an emptytracksarray.ready/liveat teardown (unpublish, endpoint change, engine destroy), the catalog track's last group is that end-of-broadcast catalog, sent after every media track has ended. A failed, closed, or GOAWAY-draining session never sends it, because a lost connection may reconnect.flushed(), which settles once every group sent so far is written and FINed.end({ after })holds its subscription FINs until a last object lands. The session's existing bounded close drain waits on it, so a stalled stream can't hold up shutdown.Behavior change worth knowing
Unpublishing and then republishing to the same namespace now looks like two broadcasts to a spec-following viewer: the first is marked complete. That matches §11.3, but the sandbox's publish toggle will now emit an end-of-broadcast catalog each time it stops. SPF's own player ignores
isComplete.The relay SDKs copied this builder and have the same bug (muxinc/relay-sdks#284). This PR doesn't touch them.
Testing
pnpm -F @videojs/spf test: new coverage for the final catalog's shape,flushed(), the deferredend({ after })inside the close drain, the unpublish path (the final catalog arrives as the last catalog object and its stream FINs cleanly, with no reset), and the session-loss path (no final catalog). I reverted each piece of the fix in turn and the matching test failed every time.pnpm lintandpnpm typecheckpass after a cleanpnpm build:packages.🤖 Generated with Claude Code
Summary by cubic
Fixes the MSF publisher writing
isComplete: trueinto every catalog, including live broadcast catalogs. Since draft-ietf-moq-msf-01 §5.1.3 makes that flag an irrevocable end-of-broadcast commitment, spec-following players and caches could treat a live stream as finished from its first catalog. Live catalogs now omit the field; a broadcast stopped on purpose ends with the §11.3 end-of-broadcast catalog (isComplete: truewith an emptytracks).flushed()hook on track publishers,end({ after })holding subscription FINs until the last object lands, and the session accepting stream opens during its orderly close drain.isComplete.Testing
flushed(), the deferredend({ after })inside the close drain, the unpublish path, and the session-loss path (no final catalog).Written for commit 8864486. Summary will update on new commits.