Skip to content

fix(spf): end published tracks with PUBLISH_DONE track ended - #62

Merged
mmcc merged 7 commits into
mmcc/moq-publisherfrom
fix/moq-publish-done-track-ended
Oct 13, 2026
Merged

mmcc merged 7 commits into
mmcc/moq-publisherfrom
fix/moq-publish-done-track-ended

Conversation

@mmcc

@mmcc mmcc commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

moq-relay 0.17.0 (sjc.relay.mux.global) reports a publisher's bare FIN on an upstream subscription as PUBLISH_DONE status 0 "internal error" to every viewer. Since this branch ended tracks with a bare FIN, every intentional unpublish looked like a failed track. The publisher now sends PUBLISH_DONE (TRACK_ENDED) with an exact Stream Count before the FIN, as draft-20 §10.12 and MSF §11.3 intend. The relay then forwards "track ended".

Changes

  • Every track end (unpublish, engine teardown, the session's close drain) sends each subscription PUBLISH_DONE with status TRACK_ENDED and its Stream Count, then FINs it.
  • The Stream Count is exact, because a relay that receives more streams than declared may close the session. Track publishers count the data streams each subscription received, at the subgroup-header commit, and the session adds the fill streams it opened. A track registered without a counter reports the 2^64−1 "unknown" sentinel, which encodePublishDone can now write.
  • A subscription the relay superseded with a newer one still ends with a bare FIN. That is not a track end, and no status code fits it.
  • The test relay hub forwards the publisher's status downstream (a bare FIN becomes INTERNAL_ERROR, matching sjc), and its trackEnds record now carries the status. The sandbox loopback relay accepts PUBLISH_DONE then FIN as a clean end.
  • The session docs and internal/design/spf/features/moq-publish.md drop the old "a track ends by FIN alone" rule.
Compatibility

Older moq-relay builds abort a track on any byte after SUBSCRIBE_OK. relay.mux.dev still runs one: with this change, its viewers lose every track on the first PUBLISH_DONE, including the §11.3 end-of-broadcast catalog. Those builds are no longer supported.

encodePublishDone lives in network/moqt (the playback branch's wire layer). The change only widens streamCount to number | undefined, so base syncs should merge cleanly.

Testing

  • pnpm -F @videojs/spf test: new coverage for per-alias stream counts, fill streams counted in the Stream Count, the unknown-count encoding, and the teardown paths asserting PUBLISH_DONE TRACK_ENDED with exact counts. 2722 tests passed in three consecutive runs. One earlier run had a single failure that didn't reproduce (test name not captured), so treat it as a possible flake.
  • pnpm lint and pnpm typecheck pass after a clean pnpm build:packages.
  • Verified live on sjc.relay.mux.global: on unpublish, viewers got the end-of-broadcast catalog, then PUBLISH_DONE status 2 "track ended" on both catalog and audio (previously status 0 "internal error"). After TRACK_ENDED, the relay also appends its own end-of-track status object, which the SPF player already skips.
  • The sandbox loopback relay change hasn't been run in a browser (sandbox templates aren't covered by typecheck or tests).

🤖 Generated with Claude Code


Summary by cubic

Ends published tracks with PUBLISH_DONE (TRACK_ENDED) and an exact Stream Count before each FIN, so intentional unpublishes no longer reach viewers as status 0 "internal error" on moq-relay 0.17.0. Previously a bare FIN ended tracks, which the relay reported as a failed track. Relay pulls whose fill cannot be reset reliably are also served now, instead of refusing the whole SUBSCRIBE with NOT_SUPPORTED.

  • Per subscription, data streams are counted at the subgroup-header commit, the session adds its fill streams, and a track without a counter reports the 2^64−1 unknown sentinel.
  • Every track now also closes its data streams before PUBLISH_DONE per §10.12: the open group gets a FIN, then a bounded flush (half the close drain window), then destroy() on the publisher.
  • A subscription the relay superseded with a newer one still ends with a bare FIN, since that is not a track end and no status fits it.
  • The test relay hub and the sandbox loopback relay now forward the publisher's status downstream; the loopback relay reports INTERNAL_ERROR on any malformed post-SUBSCRIBE_OK frame.
  • Nonempty fill requests no longer require WebTransport's commit(): the session serves the subscribe, writes the FETCH_HEADER where it can, and resets the fill as before. A reset may discard the header, which leaves the subscriber's join at the next group boundary.
  • Fill fetch streams count toward the Stream Count wherever the session opens one, even when the header may not survive the reset; a fill still opening when the track ends is reset headerless and left uncounted.
  • Older moq-relay builds abort a track on any byte after SUBSCRIBE_OK; with this change, they are no longer supported.
  • encodePublishDone's stream count widens from number to number | undefined, so base syncs should merge cleanly.

Written for commit 685c9c9. Summary will update on new commits.

View guided diff Turn on auto-fix

moq-relay 0.17.0 reports a bare FIN on an upstream subscription as
PUBLISH_DONE "internal error" to every viewer, so an intentional
unpublish looked like a failed track. Send PUBLISH_DONE (TRACK_ENDED)
with the exact Stream Count before the FIN, as §10.12 and MSF §11.3
intend; the relay then forwards "track ended".

Track publishers count the data streams each subscription received at
the subgroup-header commit, and the session adds its fill streams. A
track without a counter reports the 2^64-1 unknown sentinel. A
superseded subscription still ends with a bare FIN, since it is not a
track end.

Older moq-relay builds abort a track on any byte after SUBSCRIBE_OK and
are no longer supported.
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

📦 Bundle Size Report

🎨 @videojs/html — 2 small size changes
Path Base initial PR initial Initial diff Lazy diff
/media/moq-publish-video 25.20 kB 25.33 kB +130 B (+0.5%) —
/media/simple-moq-video 28.99 kB 28.99 kB -1 B (-0.0%) —
Presets (7)
Entry Initial Lazy
/video (default) 65.38 kB 67.46 kB
/video (default + hls) 67.10 kB 67.46 kB
/video (minimal) 65.87 kB 67.46 kB
/video (minimal + hls) 67.69 kB 67.46 kB
/audio (default) 49.09 kB 67.46 kB
/audio (minimal) 49.29 kB 67.46 kB
/background 12.62 kB 67.46 kB
Media (20)
Entry Initial
/media/mux-video 3.02 kB
/media/mux-audio 2.68 kB
/media/background-video 1.16 kB
/media/cloudflare-video 2.90 kB
/media/dash-video 2.63 kB
/media/hls-audio 23.58 kB
/media/hls-background-video 17.44 kB
/media/hls-video 33.87 kB
/media/hlsjs-video 2.63 kB
/media/moq-publish-video 25.33 kB
/media/mux-background-video 17.42 kB
/media/native-hls-video 7.68 kB
/media/shaka-video 2.63 kB
/media/simple-moq-video 28.99 kB
/media/spotify-audio 3.02 kB
/media/tiktok-video 3.12 kB
/media/twitch-video 2.93 kB
/media/vimeo-video 2.90 kB
/media/wistia-video 607 B
/media/youtube-video 2.90 kB
Players (6)
Entry Initial Lazy
/video/player 9.97 kB 67.46 kB
/audio/player 6.14 kB 67.46 kB
/background/player 4.46 kB 67.46 kB
/live-video/player 9.34 kB 67.46 kB
/live-audio/player 6.16 kB 67.46 kB
/publisher/player 6.97 kB 67.46 kB
Skins (32)
Entry Type Initial Lazy
/video/minimal-skin.css css 8.29 kB —
/video/skin.css css 8.01 kB —
/video/minimal-skin js 64.30 kB 67.46 kB
/video/minimal-skin2 js 8.28 kB —
/video/skin js 63.98 kB 67.46 kB
/video/skin2 js 7.99 kB —
/audio/minimal-skin.css css 6.07 kB —
/audio/skin.css css 5.80 kB —
/audio/minimal-skin js 47.86 kB 67.46 kB
/audio/minimal-skin2 js 6.05 kB —
/audio/skin js 47.52 kB 67.46 kB
/audio/skin2 js 5.78 kB —
/background/skin.css css 141 B —
/background/skin js 10.88 kB 67.46 kB
/background/skin2 js 159 B —
/live-video/minimal-skin.css css 6.78 kB —
/live-video/skin.css css 6.69 kB —
/live-video/minimal-skin js 51.64 kB 67.46 kB
/live-video/minimal-skin2 js 6.78 kB —
/live-video/skin js 51.56 kB 67.46 kB
/live-video/skin2 js 6.68 kB —
/live-audio/minimal-skin.css css 4.78 kB —
/live-audio/skin.css css 4.68 kB —
/live-audio/minimal-skin js 37.02 kB 67.46 kB
/live-audio/minimal-skin2 js 4.77 kB —
/live-audio/skin js 36.88 kB 67.46 kB
/live-audio/skin2 js 4.66 kB —
/publisher/skin.css css 5.38 kB —
/publisher/skin js 45.03 kB 67.46 kB
/publisher/skin2 js 5.39 kB —
/global.css css 250 B —
/shadow.css css 78 B —
UI Components (73)
Entry Initial Lazy
/ui/airplay-button 12.29 kB 67.46 kB
/ui/alert-dialog 8.98 kB 67.46 kB
/ui/audio-track-radio-group 12.40 kB 67.46 kB
/ui/buffering-indicator 9.62 kB 67.46 kB
/ui/camera-button 12.44 kB 67.46 kB
/ui/camera-radio-group 12.53 kB 67.46 kB
/ui/captions-button 12.54 kB 67.46 kB
/ui/captions-radio-group 12.46 kB 67.46 kB
/ui/capture-placeholder 10.62 kB 67.46 kB
/ui/cast-button 12.27 kB 67.46 kB
/ui/connection-indicator 10.50 kB 67.46 kB
/ui/container 10.48 kB 67.46 kB
/ui/controls 9.79 kB 67.46 kB
/ui/controls-backdrop 1.69 kB 67.46 kB
/ui/controls-content 1.67 kB 67.46 kB
/ui/dialog 8.92 kB 67.46 kB
/ui/dialog-backdrop 1.70 kB 67.46 kB
/ui/dialog-close 2.06 kB 67.46 kB
/ui/dialog-description 1.69 kB 67.46 kB
/ui/dialog-popup 1.90 kB 67.46 kB
/ui/dialog-title 1.69 kB 67.46 kB
/ui/enable-devices-button 12.49 kB 67.46 kB
/ui/error-dialog 13.41 kB 67.46 kB
/ui/fullscreen-button 12.29 kB 67.46 kB
/ui/gesture 10.72 kB 67.46 kB
/ui/hotkey 11.15 kB 67.46 kB
/ui/live-button 10.78 kB 67.46 kB
/ui/menu 19.98 kB 67.46 kB
/ui/menu-checkbox-item 1.97 kB 67.46 kB
/ui/menu-content 7.65 kB 67.46 kB
/ui/menu-group 2.09 kB 67.46 kB
/ui/menu-group-label 1.64 kB —
/ui/menu-item 2.29 kB 67.46 kB
/ui/menu-item-indicator 1.38 kB 67.46 kB
/ui/menu-radio-group 3.02 kB 67.46 kB
/ui/menu-radio-item 2.14 kB 67.46 kB
/ui/menu-separator 1.30 kB 67.46 kB
/ui/mic-button 12.43 kB 67.46 kB
/ui/mic-radio-group 12.54 kB 67.46 kB
/ui/mute-button 12.30 kB 67.46 kB
/ui/pip-button 12.25 kB 67.46 kB
/ui/play-button 12.22 kB 67.46 kB
/ui/playback-rate-button 12.33 kB 67.46 kB
/ui/playback-rate-radio-group 12.40 kB 67.46 kB
/ui/popover 8.77 kB 67.46 kB
/ui/poster 9.91 kB 67.46 kB
/ui/publish-badge 10.60 kB 67.46 kB
/ui/publish-button 11.00 kB 67.46 kB
/ui/publish-timer 11.19 kB 67.46 kB
/ui/quality-radio-group 12.92 kB 67.46 kB
/ui/screen-share-button 12.45 kB 67.46 kB
/ui/seek-button 12.28 kB 67.46 kB
/ui/seek-indicator 13.71 kB 67.46 kB
/ui/seek-indicator-value 1.10 kB —
/ui/slider 12.64 kB 67.46 kB
/ui/slider-preview 2.01 kB 67.46 kB
/ui/status-announcer 11.66 kB 67.46 kB
/ui/status-indicator 14.07 kB 67.46 kB
/ui/status-indicator-value 1.10 kB —
/ui/thumbnail 11.35 kB 67.46 kB
/ui/time 12.06 kB 67.46 kB
/ui/time-slider 14.19 kB 67.46 kB
/ui/time-slider-chapter-title 9.82 kB 67.46 kB
/ui/time-slider-chapters 10.66 kB 67.46 kB
/ui/title 9.21 kB 67.46 kB
/ui/tooltip 10.12 kB 67.46 kB
/ui/tooltip-label 1.21 kB —
/ui/tooltip-shortcut 1.18 kB —
/ui/volume-indicator 14.01 kB 67.46 kB
/ui/volume-indicator-fill 1.11 kB —
/ui/volume-indicator-value 1.10 kB —
/ui/volume-popover 15.95 kB 67.46 kB
/ui/volume-slider 13.33 kB 67.46 kB
⚛️ @videojs/react — 1 small size change
Path Base initial PR initial Initial diff Lazy diff
/media/moq-publish-video 23.83 kB 24.00 kB +173 B (+0.7%) —
Presets (7)
Entry Initial Lazy
/video (default) 59.63 kB 67.46 kB
/video (default + hls) 60.18 kB 67.46 kB
/video (minimal) 59.73 kB 67.46 kB
/video (minimal + hls) 60.30 kB 67.46 kB
/audio (default) 46.39 kB 67.46 kB
/audio (minimal) 46.45 kB 67.46 kB
/background 908 B 67.46 kB
Media (23)
Entry Initial
/media/mux-video/hls-js 1.45 kB
/media/mux-video/spf 1.46 kB
/media/mux-audio/hls-js 1.12 kB
/media/mux-audio/spf 1.13 kB
/media/background-video 513 B
/media/cloudflare-video 1.81 kB
/media/dash-video 1.11 kB
/media/hls-audio 22.27 kB
/media/hls-background-video 17.48 kB
/media/hls-video 32.63 kB
/media/hlsjs-video 1.12 kB
/media/moq-publish-video 24.00 kB
/media/mux-audio 1.12 kB
/media/mux-background-video 17.48 kB
/media/mux-video 1.44 kB
/media/native-hls-video 6.32 kB
/media/shaka-video 1.11 kB
/media/spotify-audio 1.89 kB
/media/tiktok-video 1.81 kB
/media/twitch-video 1.84 kB
/media/vimeo-video 1.79 kB
/media/wistia-video 1.41 kB
/media/youtube-video 1.79 kB
Extensions (2)
Entry Initial
/extensions/google-cast 1.77 kB
/extensions/mux-data 1.80 kB
Players (5)
Entry Initial Lazy
/video/player 8.23 kB 67.46 kB
/audio/player 4.39 kB 67.46 kB
/background/player 2.64 kB 67.46 kB
/live-video/player 7.59 kB 67.46 kB
/live-audio/player 4.40 kB 67.46 kB
Skins (20)
Entry Type Initial Lazy
/video/minimal-skin.css css 8.12 kB —
/video/skin.css css 7.81 kB —
/video/minimal-skin js 59.61 kB 67.46 kB
/video/skin js 59.51 kB 67.46 kB
/audio/minimal-skin.css css 5.88 kB —
/audio/skin.css css 5.60 kB —
/audio/minimal-skin js 46.37 kB 67.46 kB
/audio/skin js 46.34 kB 67.46 kB
/background/skin.css css 97 B —
/background/skin js 514 B —
/live-video/minimal-skin.css css 6.60 kB —
/live-video/skin.css css 6.51 kB —
/live-video/minimal-skin js 49.43 kB 67.46 kB
/live-video/skin js 49.55 kB 67.46 kB
/live-audio/minimal-skin.css css 4.58 kB —
/live-audio/skin.css css 4.47 kB —
/live-audio/minimal-skin js 34.64 kB 67.46 kB
/live-audio/skin js 34.64 kB 67.46 kB
/publisher/skin.css css 5.19 kB —
/publisher/skin js 37.34 kB 67.46 kB
UI Components (50)
Entry Initial Lazy
/ui/airplay-button 12.01 kB 67.46 kB
/ui/alert-dialog 5.20 kB 67.46 kB
/ui/audio-track 9.13 kB 67.46 kB
/ui/audio-track-radio-group 11.57 kB 67.46 kB
/ui/buffering-indicator 9.18 kB 67.46 kB
/ui/camera-button 12.16 kB 67.46 kB
/ui/camera-radio-group 11.49 kB 67.46 kB
/ui/captions-button 11.98 kB 67.46 kB
/ui/captions-radio-group 11.68 kB 67.46 kB
/ui/capture-placeholder 9.93 kB 67.46 kB
/ui/cast-button 12.00 kB 67.46 kB
/ui/connection-indicator 9.87 kB 67.46 kB
/ui/controls 9.06 kB 67.46 kB
/ui/dialog 5.20 kB 67.46 kB
/ui/enable-devices-button 12.24 kB 67.46 kB
/ui/error-dialog 13.40 kB 67.46 kB
/ui/fullscreen-button 11.96 kB 67.46 kB
/ui/gesture 9.35 kB 67.46 kB
/ui/hotkey 9.78 kB 67.46 kB
/ui/live-button 10.32 kB 67.46 kB
/ui/menu 22.80 kB 67.46 kB
/ui/mic-button 12.16 kB 67.46 kB
/ui/mic-radio-group 11.49 kB 67.46 kB
/ui/mute-button 12.02 kB 67.46 kB
/ui/pip-button 11.97 kB 67.46 kB
/ui/play-button 11.94 kB 67.46 kB
/ui/playback-rate 9.20 kB 67.46 kB
/ui/playback-rate-button 11.92 kB 67.46 kB
/ui/playback-rate-radio-group 11.62 kB 67.46 kB
/ui/popover 9.12 kB 67.46 kB
/ui/poster 9.39 kB 67.46 kB
/ui/publish-badge 9.91 kB 67.46 kB
/ui/publish-button 10.53 kB 67.46 kB
/ui/publish-timer 10.50 kB 67.46 kB
/ui/quality 9.56 kB 67.46 kB
/ui/quality-radio-group 11.98 kB 67.46 kB
/ui/screen-share-button 12.18 kB 67.46 kB
/ui/seek-button 11.96 kB 67.46 kB
/ui/seek-indicator 13.69 kB 67.46 kB
/ui/slider 15.13 kB 67.46 kB
/ui/status-announcer 11.59 kB 67.46 kB
/ui/status-indicator 14.13 kB 67.46 kB
/ui/thumbnail 10.57 kB 67.46 kB
/ui/time 11.40 kB 67.46 kB
/ui/time-slider 16.94 kB 67.46 kB
/ui/title 8.64 kB 67.46 kB
/ui/tooltip 9.98 kB 67.46 kB
/ui/volume-indicator 14.17 kB 67.46 kB
/ui/volume-popover 16.32 kB 67.46 kB
/ui/volume-slider 13.79 kB 67.46 kB
🧩 @videojs/core — no changes
Entries (77)
Entry Initial Lazy
. 14.76 kB —
/dom 24.40 kB 67.46 kB
/vjsc 2.23 kB —
/i18n 3.42 kB 67.46 kB
/i18n/locales/all 34.29 kB —
/i18n/locales/ar 1.39 kB —
/i18n/locales/az 1.29 kB —
/i18n/locales/bg 1.54 kB —
/i18n/locales/bn 1.49 kB —
/i18n/locales/bs 1.24 kB —
/i18n/locales/ca 1.26 kB —
/i18n/locales/cs 1.32 kB —
/i18n/locales/cy 1.24 kB —
/i18n/locales/da 1.17 kB —
/i18n/locales/de 1.28 kB —
/i18n/locales/el 1.65 kB —
/i18n/locales/en 1005 B —
/i18n/locales/es 1.19 kB —
/i18n/locales/et 1.24 kB —
/i18n/locales/eu 1.27 kB —
/i18n/locales/fa 1.43 kB —
/i18n/locales/fi 1.27 kB —
/i18n/locales/fr 1.23 kB —
/i18n/locales/gd 1.31 kB —
/i18n/locales/gl 1.21 kB —
/i18n/locales/he 1.33 kB —
/i18n/locales/hi 1.50 kB —
/i18n/locales/hr 1.27 kB —
/i18n/locales/hu 1.32 kB —
/i18n/locales/id 1.15 kB —
/i18n/locales/it 1.23 kB —
/i18n/locales/ja 1.39 kB —
/i18n/locales/ko 1.31 kB —
/i18n/locales/lt 1.26 kB —
/i18n/locales/lv 1.31 kB —
/i18n/locales/mr 1.48 kB —
/i18n/locales/nb 1.19 kB —
/i18n/locales/ne 1.46 kB —
/i18n/locales/nl 1.22 kB —
/i18n/locales/nn 1.18 kB —
/i18n/locales/oc 1.27 kB —
/i18n/locales/pl 1.33 kB —
/i18n/locales/pt 1.23 kB —
/i18n/locales/pt-BR 1.23 kB —
/i18n/locales/pt-PT 1.23 kB —
/i18n/locales/ro 1.26 kB —
/i18n/locales/ru 1.59 kB —
/i18n/locales/sk 1.32 kB —
/i18n/locales/sl 1.26 kB —
/i18n/locales/sr 1.28 kB —
/i18n/locales/sv 1.22 kB —
/i18n/locales/te 1.53 kB —
/i18n/locales/th 1.45 kB —
/i18n/locales/tr 1.22 kB —
/i18n/locales/uk 1.60 kB —
/i18n/locales/vi 1.33 kB —
/i18n/locales/zh 1.24 kB —
/i18n/locales/zh-CN 1.24 kB —
/i18n/locales/zh-TW 1.24 kB —
/i18n/text/airplay 101 B —
/i18n/text/buttons 137 B —
/i18n/text/captions 93 B —
/i18n/text/cast 114 B —
/i18n/text/common 90 B —
/i18n/text/container 75 B —
/i18n/text/errors 285 B —
/i18n/text/fullscreen 98 B —
/i18n/text/live 126 B —
/i18n/text/menu 249 B —
/i18n/text/pip 101 B —
/i18n/text/playback 80 B —
/i18n/text/publish 451 B —
/i18n/text/seek 105 B —
/i18n/text/slider 65 B —
/i18n/text/status 222 B —
/i18n/text/time 322 B —
/i18n/text/volume 133 B —
🏷️ @videojs/element — no changes
Entries (2)
Entry Initial
. 1.05 kB
/context 943 B
📦 @videojs/store — no changes
Entries (3)
Entry Initial
. 1.72 kB
/html 703 B
/react 511 B
🔧 @videojs/utils — no changes
Entries (13)
Entry Initial
/array 271 B
/dom 5.25 kB
/events 320 B
/function 414 B
/i18n 249 B
/jwt 176 B
/object 535 B
/predicate 297 B
/percent 281 B
/string 239 B
/style 212 B
/time 1018 B
/number 199 B
📦 @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 changes
Entries (3)
Entry Initial
. 1.41 kB
/dom 4.12 kB
/media-tracks 2.05 kB
📦 @videojs/mux — no changes
📦 @videojs/mux-audio — no changes
Entries (2)
Entry Initial
. 136.12 kB
/spf 22.85 kB
📦 @videojs/mux-data — no changes
📦 @videojs/mux-video — no changes
Entries (2)
Entry Initial
. 136.12 kB
/spf 33.01 kB
📦 @videojs/native-hls-video — no changes
📦 @videojs/shaka-video — no changes
📦 @videojs/spf — 3 small size changes
Path Base initial PR initial Initial diff Lazy diff
/moq 27.51 kB 27.50 kB -16 B (-0.1%) —
/moq-publish 21.66 kB 21.74 kB +79 B (+0.4%) —
/moq-publish-video 22.87 kB 22.97 kB +95 B (+0.4%) —
Entries (10)
Entry Initial
. 4.55 kB
/dom 7.67 kB
/hls 28.21 kB
/media-tracks 607 B
/moq 27.50 kB
/moq-publish 21.74 kB
/moq-publish-video 22.97 kB
/hls-background-video 16.47 kB
/hls-audio 21.36 kB
/hls-video 31.73 kB
📦 @videojs/spotify-audio — no changes
📦 @videojs/tiktok-video — no changes
📦 @videojs/twitch-video — no changes
📦 @videojs/other — 1 small size change
Path Base initial PR initial Initial diff Lazy diff
video.js 95.61 kB 95.70 kB +96 B (+0.1%) 0 B
Entries (3)
Entry Initial Lazy
video.js 95.70 kB 67.46 kB
video.js/package.json 608 B —
video.js/errors 1.03 kB —
📦 @videojs/vimeo-video — no changes
📦 @videojs/wistia-video — no changes
Entries (2)
Entry Initial
. 1.91 kB
/helpers 1.77 kB
📦 @videojs/youtube-video — no changes

ℹ️ How to interpret

Each 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 pnpm size locally to check current initial sizes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e1c860b01

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T21:45:33.459358Z 1e1c860 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 15 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

mmcc added 2 commits October 7, 2026 21:56
Draft-20 §10.12: a sender MUST NOT send PUBLISH_DONE until it has
closed every stream for the subscription. Media teardown wrote
PUBLISH_DONE while the open group's FIN was still queued, and the
catalog path raced destroy() against it on a flush timeout. Every track
now ends the same way: end, a bounded flush (half the close drain, so
PUBLISH_DONE still fits), destroy() to FIN or reset what is left, then
PUBLISH_DONE and FIN.

Also prune superseded aliases from the per-subscription stream counts
on each new bind, keeping the current alias across a Forward State
toggle.
The loopback relay reduced the publisher's PUBLISH_DONE to a FIN toward
its players, which the SPF subscriber ignores, so a viewer only noticed
the track end through its stall watchdog. Forward the upstream status
with a per-subscription Stream Count, like moq-relay 0.17.0, and end
viewers with INTERNAL_ERROR when the upstream subscription stream
carries anything else, including a malformed frame.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sandbox/templates/moq-publisher/loopback-relay.ts">

<violation number="1" location="apps/sandbox/templates/moq-publisher/loopback-relay.ts:801">
P2: A malformed PUBLISH_DONE body can leave every attached player waiting indefinitely: an empty body makes `Reader.varint()` throw, and the outer catch cleans up the upstream without ending subscribers. Validate the complete body here and end subscribers with INTERNAL_ERROR when it is malformed.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

return;
}

publishDoneStatus = new Reader(message.body).varint();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: A malformed PUBLISH_DONE body can leave every attached player waiting indefinitely: an empty body makes Reader.varint() throw, and the outer catch cleans up the upstream without ending subscribers. Validate the complete body here and end subscribers with INTERNAL_ERROR when it is malformed.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sandbox/templates/moq-publisher/loopback-relay.ts, line 801:

<comment>A malformed PUBLISH_DONE body can leave every attached player waiting indefinitely: an empty body makes `Reader.varint()` throw, and the outer catch cleans up the upstream without ending subscribers. Validate the complete body here and end subscribers with INTERNAL_ERROR when it is malformed.</comment>

<file context>
@@ -771,29 +780,32 @@ export function createPublisherLoopbackRelay({ onLog }: PublisherLoopbackRelayOp
             return;
           }
+
+          publishDoneStatus = new Reader(message.body).varint();
         }
 
</file context>
Suggested change
publishDoneStatus = new Reader(message.body).varint();
try {
const fields = new Reader(message.body);
publishDoneStatus = fields.varint();
fields.varint(); // stream count
const reasonLength = fields.varint();
if (fields.offset + reasonLength !== message.body.length) throw new Error('malformed PUBLISH_DONE body');
fields.slice(reasonLength);
} catch {
log(`upstream ${track.name}: malformed PUBLISH_DONE after SUBSCRIBE_OK — aborting the track`);
for (const subscriber of [...track.subscribers]) subscriber.end(PUBLISH_DONE_INTERNAL_ERROR);
return;
}

a-bro and others added 4 commits October 8, 2026 11:24
Moq-relay (0.14.17 through 0.17.0) subscribes upstream with Next Object
plus FILL_PARAMETERS for the current group. Once a track has content
that fill range is nonempty, and the publish session refused the whole
SUBSCRIBE with NOT_SUPPORTED when the transport's writers lack
WebTransport's commit() (RESET_STREAM_AT). Chromium 147 has no
commit(), so in the browser a relay's second pull of a live track always
failed: the real subscribe after a cross-relay TRACK_INFO probe, or any
re-subscribe after the last viewer left. Players on another relay never
got a catalog.

Serve the subscription, and fail the fill as before: write the
FETCH_HEADER, commit it where the writer can, and reset. Without commit()
the reset may discard the header, and the subscriber sees no fill, which
leaves its join at the next group boundary, as a failed fill does.
REQUEST_UPDATE fills get the same treatment instead of ending the
subscription.

Stacked on #62, which ends tracks with PUBLISH_DONE and an exact Stream
Count. There the fill counted only past the commit() gate this change
removes. It now counts wherever the session opens one, whether or not
its header survives the reset: §10.12 counts the streams the publisher
opened, fill fetch streams included. A subscriber waits out a timeout
for a stream reset before its header, but one that receives more
streams than the count may close the session. moq-relay 0.17.0 never
closes on either: it ends the track once the counted streams and the
fill have arrived, or after a 1 s grace. A lost fill header leaves its
fill outstanding, so that track end waits out the grace whatever the
count says.

The relay hub can now model a transport without commit(). The session
tests cover the relay's probe-then-subscribe sequence, and the Stream
Count of a fill reset without commit(), with its header delivered and
lost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ts6nhCDi2pBF9h5ooBNbss
… end

Review (cubic, #63) read the fill counter's comment as "count every
stream this side opens" and flagged a fill whose stream is still opening
when the track ends: PUBLISH_DONE goes out without it. That is the
intended rule, the one the track publisher applies to subgroup streams
(#62): a stream counts in the step that commits it to its header, so a
stream reset before its header, which the subscriber cannot attribute
to the subscription, is left out. The late fill is reset with no
header, so the count can never fall short of the streams the subscriber
can tie to the subscription.

Reword the comment to say so, including the over-count side (a counted
fill whose reset discards its header, or whose write rejects), which
§10.12 covers with the subscriber's timeout. Add a test that ends the
track while the fill's open is pending, with and without reliable
reset: Stream Count 3, the fill stream gets no write and is aborted.
Review (cubic, #63) suspected the probe's unbind could land after pull
237's bind and leave the binding undefined. It cannot: a subscription's
end reports the newest live binding, not an unbind, and pull 237 is
already accepted. Run the relay test both ways, with the probe cancelled
before and after the second pull, and check the binding is still 237
once the probe's end has been handled. Reporting an unbind there fails
the new case.
fix(spf): serve relay pulls whose fill cannot be reset reliably
@mmcc
mmcc merged commit 639a48d into mmcc/moq-publisher Oct 13, 2026
13 of 15 checks passed
@mmcc
mmcc deleted the fix/moq-publish-done-track-ended branch October 13, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants