[codex] implement JS lite FETCH#2032
Draft
kixelated wants to merge 2 commits into
Draft
Conversation
There was a problem hiding this comment.
Sorry @kixelated, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
…class, not callbacks The consume side registered per-operation closures on the shared Broadcast (onTrackInfo / onFetchGroup, stashed as #infoResolver / #fetchResolver). Drop those callbacks entirely: a consumed broadcast is now a ConsumeBroadcast that extends Broadcast and holds a direct reference to the Subscriber it was opened from, overriding resolveTrackInfo / resolveFetchGroup to fetch over the wire. This mirrors the Rust BroadcastConsumer, which owns its session and calls methods on it rather than having the session install callbacks. - lite: ConsumeBroadcast overrides both, issuing TRACK_INFO / FETCH (lite-05+). - ietf: ConsumeBroadcast overrides only resolveFetchGroup to reject (no one-shot fetch in moq-transport); track info stays on the inherited subscribe path. - The base Broadcast keeps the local produce-side implementations (static/requested track info, retained-window group scan) as the default the subclass overrides. No exported @internal interface, no stored function values. Behavior is unchanged; the wire->model TrackInfo mapping is factored into one helper. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cc2ccaa to
acab008
Compare
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.
Summary
TrackConsumer.fetchGroup(sequence, options?)andFetchGroupOptionsfor one-shot group fetches.fetchGroup()for moq-transport until the IETF path has a real implementation.Consume-side design (no callbacks)
Instead of registering per-operation closures on the shared
Broadcast(the oldonTrackInfo/onFetchGroupresolvers), a consumed broadcast is now aConsumeBroadcastthatextends Broadcastand holds a direct reference to theSubscriberit was opened from. It overridesresolveTrackInfo/resolveFetchGroupto fetch over the wire. This mirrors the RustBroadcastConsumer, which owns its session and calls methods on it rather than having the session install callbacks.ConsumeBroadcastoverrides both, issuing TRACK_INFO / FETCH (lite-05+).ConsumeBroadcastoverrides onlyresolveFetchGroupto reject (moq-transport has no one-shot fetch); track info stays on the inherited subscribe path.Broadcastkeeps the local produce-side implementations (static/requested track info, retained-window group scan) as the default the subclass overrides.There is no exported
@internalinterface and no stored function values.Root Cause
The JS lite FETCH message codec existed, but the runtime never dispatched
StreamId.Fetchand the subscriber side had no API to issue FETCH. A Rust lite-05 subscriber could therefore open stream type3against JS and getunknown stream type: 3.Public API Changes
TrackConsumer.fetchGroup(sequence, options?)method.FetchGroupOptionsinterface with optionalpriority.Breaking changes: none for external consumers. (Internally, the
Broadcast.onTrackInfowire-layer resolver setter is removed in favor of the subclass; it was never part of the intended public surface.)Validation
just js check(@moq/net type-check + lint pass)just js test(all 190 @moq/net tests pass, including the lite cached-group fetch and the ietf unsupported-fetch integration tests)(Reworked by Claude Opus 4.8; original implementation written by GPT-5)