Repository navigation
fix(net): a fetch stream states the track's publisher priority - #7790
Conversation
The first object on a moq-transport fetch stream carries the Publisher Priority every later object inherits. Both publishers hardcoded it as 0, the most urgent value, whatever the track's priority, while subgroup headers, datagrams and FETCH_OK all state the track's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two remaining moq-transport priority crossings without a test are the forks a draft-22 fill reads the cache through: the SUBSCRIBE fill's snapshot and the fork an update's fill holds. Replacing either fromWire(msg.subscriberPriority) with the bare wire byte left every test green. Every other crossing, Rust and JS, already fails under that mutation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re-apply the fetch stream's publisher priority onto main's single-group FETCH and fill: JS threads it through FetchWriter, and Rust drops the prior_group plumbing every caller now passes as None, so write_fetch_group takes the priority without a too_many_arguments exemption. The priority tests now fetch one group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou'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 1 minute. View limit details
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. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head: 863cfbc.
No actionable finding. Rust and JS carry the converted track publisher priority into standalone, joining and fill FETCH writers, with the first object stating it and later objects inheriting it. The removed Rust multi-group state is unused by the current single-group fetch and fill paths; the nondefault-priority and conversion tests cover those changes.
Verification: static GitHub inspection of both publishers, wire encoding, call sites and tests. I did not run the tests or interoperability lanes.
(Written by review (OpenAI))
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Fetch stream priority in Rust:
write_fetch_groupresolves the track's Publisher Priority fromtrack.info()andwrite_fetched_groupfromFetchedGroup.info, both throughpriority::to_wire, so the first fetch object states the same byte FETCH_OK and subgroup headers do. - Dead multi-group plumbing removed:
FetchPrior::Group,fetch_position, and theprior_groupparameters are gone, since the publisher now serves a single group per fetch stream. The subscriber's multi-group reader support is untouched, so third-party multi-group fetches still decode. - Fetch stream priority in JS:
FetchFramerequirespriorityand writes it on the first object;FetchWriterpasses it through fromFetchAnswer,Joinable, andRunFill, all sourced fromtoWire(info.priority). - Tests: Rust and JS standalone/fill priority tests, the joining-FETCH expectations moved from
0to127, and two JS tests pinning that a fill's cache fork uses the converted subscriber priority.
I ran the full JS src/ietf suite (590 pass, 0 fail, including the new tests). Rust could not be built here because libspa-sys needs libpipewire-0.3, which is absent outside the Nix dev shell, so the Rust changes were validated by reading; the new logic is a direct conversion on values the surrounding code already uses.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Replaces moq-dev/moq#7583 by @kkroo (Omar Ramadan). Thank you! That PR's branch lives on the organization-owned fork
Blockcast/moq, and GitHub doesn't let maintainers push to organization-owned forks, so it couldn't be brought up to date in place. This branch keeps kkroo's two commits and their authorship unchanged, and adds merges ofmainon top.Problem
A moq-transport fetch stream's first object carries the Publisher Priority that every later object inherits. Both publishers hardcoded it as
0, the most urgent value on the lower-first wire, regardless of the track'spriority:ietf/publisher.rswroteSome(0).FetchFrame.encodewrote0.Subgroup headers, datagrams and FETCH_OK all state
to_wire(track.priority). So a fetched object disagreed with the FETCH_OK above it, every fetch outranked every group stream, and a relay or peer ranking by publisher priority couldn't tell a catalog fetch from a video one.Approach
The track's wire priority now reaches every fetch writer through the existing
priority::to_wire/toWire:write_fetch_group(draft-22 fill) resolves the priority from the track it fills.write_fetched_group(standalone and joining FETCH) reads it from the fetched group's track info.FetchWritertakes the priority and hands it toFetchFrame, which now requirespriority. It comes fromFetchAnswer,RunFilland the joining subscription'sJoinable.Merging
mainbrought in the single-group FETCH and fill rewrite, so the fix was re-applied onto it:prior_group = None. That dead multi-group plumbing (fetch_position,FetchPrior::Group, theprior_groupparameters) is removed, sowrite_fetch_grouptakes the priority without atoo_many_argumentsexemption.Tests
a_standalone_fetch_states_the_track_priority(drafts 18, 20 and 22) anda_fill_states_the_track_priority: model priority 72 must put wire55on the first object and nothing on the rest.a FETCH states the track's priority on its first object(every draft), and theFetchFramebyte test at priority 55.0next to a FETCH_OK stating127; both now expect127.0fails three Rust and three JS tests.Verification
cargo test -p moq-net --lib: 2905 pass.bun test src/ietfinjs/net: 590 pass.-D warnings,cargo fmtand biome are clean.just test interop --tail --versions moq-transport-18,moq-transport-22: every lane passes (CLI FETCH, late join via joining FETCH and fill, finite tails), Rust, Node and Bun in both directions.Impact
FetchFrame(ietf/object.ts) takes a requiredpriorityin its constructor.Alternatives
Omitting the priority on the first object isn't possible: there's no prior object to inherit it from.
Follow-ups
None. The subscriber doesn't read FETCH_OK's priority, by design since moq-dev/moq#4974: it learns a track's priority from SUBSCRIBE_OK or TRACK_STATUS_OK before any FETCH.
Review
quest review --base origin/main, Codexgpt-6.1-sol, medium effort (round 1).863cfbc01902214354f361bdbe2c318382a51143.🤖 Generated with Claude Code