Commit a5b185a
moq-lite-05: replace SUBSCRIBE_OK/FETCH_OK with on-demand Track Stream (#25)
* moq-lite-05: replace SUBSCRIBE_OK/FETCH_OK with on-demand Track Stream
Publisher track properties (priority, ordered, cache, timescale,
compression) were echoed on every SUBSCRIBE_OK and (newly) FETCH_OK,
repeating the same immutable data on every response — wasteful for
group-by-group fetches in particular.
Make those properties immutable for the lifetime of a track and move
them to a dedicated Track Stream (0x6): TRACK request -> single
TRACK_INFO reply -> FIN. The subscriber fetches it once and caches it,
reusing it across every SUBSCRIBE and FETCH.
As a result:
- Remove SUBSCRIBE_OK: a subscription is now accepted implicitly
(rejection is a stream reset). The resolved group range moves into
dedicated SUBSCRIBE_START / SUBSCRIBE_END messages; subtypes
renumbered START=0x0, END=0x1, DROP=0x2.
- Remove FETCH_OK: a FETCH returns bare FRAME messages again.
- Immutability rationale: publisher-side changes would fan *out* to
every downstream of a relay; subscriber properties fan *in* and may
still change via SUBSCRIBE_UPDATE.
- Rework the Prioritization example so active-speaker adaptation is
driven by subscriber priority (publisher priority can no longer be
bumped mid-subscription).
The subscriber MUST have TRACK_INFO before parsing frames (timescale
and compression determine the frame wire format); it MAY open the Track
and Subscribe/Fetch streams concurrently and buffer until it arrives.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* moq-lite-05: prioritize TRACK_INFO; clarify cache invalidation
Address review feedback on the Track Stream:
- Publisher SHOULD send TRACK_INFO ahead of group data. The concurrent
flighting that keeps a cold subscribe/fetch to one RTT only holds if
TRACK_INFO isn't starved behind group frames the subscriber can't yet
parse (timescale/compression define the FRAME wire format).
- Clarify cache invalidation for tracks reached without an ANNOUNCE:
there's no re-announcement signal, so such a subscriber SHOULD NOT
cache TRACK_INFO beyond a single connection and MAY re-request it to
confirm freshness.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* moq-lite-05: address CodeRabbit review on Track Stream
- Subscribe: specify that a publisher MUST reset a subscription it cannot
serve (promptly, ~1 RTT) rather than leave it pending, and that an
accepted-but-empty subscription is signaled via SUBSCRIBE_START
(deferred for live) or SUBSCRIBE_END (ended track), not a timeout.
- TRACK_INFO cache: strengthen re-announce invalidation from SHOULD to
MUST (discard + re-request before parsing further frames), and require
a stream reset + re-fetch if frames can't be decoded against the cache.
- Fix lifetime wording: Publisher Priority is fixed for the lifetime of
the Track, not the subscription (matches TRACK_INFO).
- Clarify unrecognized-compression handling: don't open Subscribe/Fetch
streams; reset an already-open one; the Track Stream is already FIN'd.
- Add `text` language hint to the prioritization example code fences.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* moq-lite-05: rename SUBSCRIBE_START back to SUBSCRIBE_OK
Keep the MoqTransport / older-version name and its role as the
publisher's positive response, even though it is now trimmed to a single
resolved start group (all other per-track properties live in TRACK_INFO).
- SUBSCRIBE_START -> SUBSCRIBE_OK (Type 0x0, single Group field); anchor
and all references updated.
- Reconcile the changelog: SUBSCRIBE_OK is kept (trimmed), not removed;
only FETCH_OK was removed. Group range is split across SUBSCRIBE_OK
(start) and SUBSCRIBE_END (end).
- Clarify the empty-ended-track case: SUBSCRIBE_END is sent with no
preceding SUBSCRIBE_OK, since there is no start group to resolve.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* moq-lite-05: make SUBSCRIBE response ordering explicitly conditional
Line 290 read as though SUBSCRIBE_OK always precedes SUBSCRIBE_END,
contradicting the empty-ended-track case. State the two cases explicitly
(start resolvable -> SUBSCRIBE_OK first; ended-with-no-groups ->
SUBSCRIBE_END alone) so the no-start-group path isn't read as a protocol
violation, and drop the now-duplicated empty-ended clause.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 74b3e38 commit a5b185a
1 file changed
Lines changed: 143 additions & 68 deletions
0 commit comments