Skip to content

feat(net): JavaScript answers IETF TRACK_STATUS - #5468

Merged
kixelated merged 3 commits into
mainfrom
quest/m1/js-track-status
Oct 14, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m1/js-track-status

Conversation

@kixelated

@kixelated kixelated commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

A @moq/net publisher now answers IETF TRACK_STATUS on every draft instead of refusing it NOT_SUPPORTED. A native fetch-only request on drafts 14-16 and 18-22 learns the track in one round trip, with no SUBSCRIBE fallback. Draft 17 still subscribes, because its TRACK_STATUS_OK cannot say whether the track is timed (TrackStatusOk::describes_track on the Rust side, unchanged).

Mirrors run_track_status_stream in rs/moq-net/src/ietf/publisher.rs:

  • The grant is checked before anything resolves. A grant that narrows while the lookup runs refuses with UNAUTHORIZED, and one that narrows while the answer is being written resets the stream.
  • The broadcast resolves through the serving origin the way a SUBSCRIBE does, dynamic handlers included. The answer waits on the track's info through the existing non-subscribing lookup (resolveTrackInfo), so the track is never subscribed.
  • LARGEST_OBJECT is whatever the producer's cache holds at that moment. A new package-private wire.Broadcast.largest(name) reads it without subscribing.
  • A requester that cancels gets nothing back. Cancelling releases the origin demand (the fix(net): release origin demand when requests are cancelled #5411 path) and the track lookup.
  • Errors use the same refusal codes as SUBSCRIBE: DOES_NOT_EXIST for a missing broadcast or track, INTERNAL otherwise.

Codec: the obsolete pre-draft-14 TrackStatus class is replaced by TrackStatusOk, which mirrors Rust. On draft 14 it is the SUBSCRIBE_OK body with Track Alias 0 under type 0x0E. On later drafts it is REQUEST_OK with LARGEST_OBJECT, plus GROUP_ORDER on draft 15 and Track Properties from draft 18. TrackStatusRequest now keeps INCLUDE_PROPERTIES. SUBSCRIBE and TRACK_STATUS share the broadcast resolution and refusal helpers, so the refusal bytes come from one place.

Public API and wire impact

  • Public API: none. TrackStatusOk, TRACK_STATUS_ERROR_14, the cachedLargest hook, and wire.Broadcast.largest are package-internal.
  • Wire: JS now sends TRACK_STATUS_OK (0x0E on draft 14, REQUEST_OK 0x07 after) where it used to send TRACK_STATUS_ERROR / REQUEST_ERROR NOT_SUPPORTED. These are the existing formats, so no draft changes. The SUBSCRIBE refusal for a missing broadcast now says not found: broadcast <path> where it used to say broadcast not found. The code is unchanged.
  • Docs: doc/concept/standard.md no longer lists JavaScript among the TRACK_STATUS refusals.

Tests

  • js/net/src/ietf/publisher.test.ts, each run on every draft from 14 to 22:
    • answered without subscribing, with INCLUDE_PROPERTIES on and off
    • an empty track gets no largest
    • refused outside the grant, and when the grant narrows mid-lookup
    • DOES_NOT_EXIST for a missing broadcast or track
    • a cancelled request releases its origin demand and its track lookup
  • ietf.test.ts: TrackStatusOk round trip on every draft.
  • New Rust/Bun interop ietf_track_status_interop, wired into just test interop: Rust encodes TRACK_STATUS, the JS publisher answers through test/interop/track-status.ts, and Rust decodes the TRACK_STATUS_OK and the DOES_NOT_EXIST refusal the way its subscriber reads them, on drafts 14-22.
  • just check, bun test in js/net, and just test interop --all.

Decisions

Follow-ups

  • quest/m1/js-fetch.md now says to check, once JS FETCH lands, whether the Rust IETF subscriber still needs to fall back to SUBSCRIBE on a NOT_SUPPORTED TRACK_STATUS, and to delete the fallback if no in-tree publisher refuses anymore.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Quest outcome: implemented as planned in quest/m1/js-track-status.md, which this PR deletes. References to it in quest/m1/README.md and quest/m1/js-fetch.md are updated.

Local results:

  • just test interop --all: all checks passed, including the new ietf_track_status_interop on drafts 14-22.
  • bun test passes in js/net (1802 tests) and js/publish.
  • cargo nextest run -p moq-net --all-targets with warnings denied: 1997 passed.
  • just check: the lint, type-check, and build stages passed. My 30-minute wrapper timeout killed the workspace-wide Rust test stage on a busy machine; the moq-net run above covers the only Rust change, which is a test.

Open note for review: a native reader that only fetches, against a JS publisher, now gets TRACK_STATUS_OK and then has its FETCH refused. Before, it fell back to SUBSCRIBE. The common case #5409 found, where a subscription follows right after the query, still subscribes. The FETCH gap belongs to /quest/m1/js-fetch.md.

(Written by Claude Opus 5.5)

kixelated and others added 3 commits October 13, 2026 15:51
A @moq/net publisher answers TRACK_STATUS on every draft instead of
refusing it NOT_SUPPORTED, mirroring the Rust publisher: the grant is
checked first, the broadcast resolves through the serving origin, the
answer waits on the track's info without subscribing, and a cancelled
request releases its origin demand and track lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review October 13, 2026 23:38
@kixelated
kixelated force-pushed the quest/m1/js-track-status branch from addcbcf to c8fdde6 Compare October 13, 2026 23:38
@kixelated

Copy link
Copy Markdown
Collaborator Author

Rebased on main. The maintainer chose to ship as is (✅ in the PR body). quest/m1/js-fetch.md now records the follow-up: once JS FETCH lands, check the Rust SUBSCRIBE fallback.

Local checks on the rebased head:

  • just check passed every stage except one Rust test, moq-relay auth::refresh::tests::an_outage_refuses_transiently_and_never_extends_the_expiry. It failed twice under the full just check load with "the session outlived its only accepted grant: ~28s". It is a paused-time bound in rs/moq-relay/src/auth/refresh.rs that this PR does not touch, and it passed 3 of 3 times on its own.
  • The workspace Rust test stage, run on its own with warnings denied, passed all 6849 tests. The Rust lint stage passed.
  • The just check stages after rs, which that failure had cut short, all passed: quest, drill, markdown, shell, toml, gh, justfile, and flake.
  • just test interop --all passed earlier on the pre-rebase head.

(Written by Claude Opus 5.5)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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-13T23:42:09.774285Z c8fdde6 Draft marked ready
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c23a13dd-0118-4f5d-bd4b-de5b5bc742d5
📥 Commits

Reviewing files that changed from the base of the PR and between 687eb57 and addcbcf.

📒 Files selected for processing: 17
  • doc/concept/standard.md
  • js/net/src/broadcast.ts
  • js/net/src/ietf/connection.ts
  • js/net/src/ietf/ietf.test.ts
  • js/net/src/ietf/publisher.test.ts
  • js/net/src/ietf/publisher.ts
  • js/net/src/ietf/track.ts
  • js/net/src/internal.ts
  • js/net/src/track.ts
  • js/net/src/wire.ts
  • quest/m1/README.md
  • quest/m1/js-fetch.md
  • quest/m1/js-track-status.md
  • rs/moq-net/src/test_interop.rs
  • test/interop/README.md
  • test/interop/track-status.ts
  • test/justfile
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary: a @moq/net publisher now answers IETF TRACK_STATUS on every draft, mirroring the Rust publisher. It checks the grant first, resolves the broadcast through the origin, waits for the track's info without subscribing, reports the cached largest location, and releases its demand when the requester cancels. There is no public API change. On the wire, JS sends the existing TRACK_STATUS_OK formats where it used to refuse NOT_SUPPORTED.

Decisions: ✅ ship as is, so a reader that only fetches from JS now gets TRACK_STATUS_OK and then a refused FETCH. JavaScript FETCH (/quest/m1/js-fetch.md) closes that gap, and that quest also records checking the Rust SUBSCRIBE fallback once it lands.

Review: Codex reviewed c8fdde6 with no findings. Every CI check passed.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit 5e94e50 Oct 14, 2026
12 checks passed
@kixelated
kixelated deleted the quest/m1/js-track-status branch October 14, 2026 00:32
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.

1 participant