Skip to content

fix(moq-transport): compute correct object_id_delta in serve_subgroup#153

Open
thexeos wants to merge 1 commit intocloudflare:mainfrom
thexeos:fix/object-id-delta
Open

fix(moq-transport): compute correct object_id_delta in serve_subgroup#153
thexeos wants to merge 1 commit intocloudflare:mainfrom
thexeos:fix/object-id-delta

Conversation

@thexeos
Copy link
Copy Markdown

@thexeos thexeos commented Mar 21, 2026

In moq-transport/src/session/subscribed.rs, the serve_subgroup method hardcodes object_id_delta: 0 for every object when re-serving subgroup data to downstream subscribers. Every object in a subgroup is received by downstream subscribers with object_id=0.

In draft-14, object IDs within a subgroup are delta-encoded (the receiver accumulates deltas to reconstruct absolute IDs - current_object_id += delta). With delta always 0, the accumulator never advances and this corrupts object ordering for any client subscribing through the relay, causing playback failures. Direct publisher-to-client connections are unaffected - only relayed subscriptions are broken.

To fix, track a running current_object_id accumulator (starting at 0) in the serving loop, then compute each delta as object_id - current_object_id (matching the inverse of the decode logic in subscriber.rs:543).

The serve_subgroup method was hardcoding object_id_delta to 0 for every
object re-served to downstream subscribers. Since object_id_delta is used
to reconstruct the actual object ID, this caused all objects to appear
as object_id=0 to downstream clients, corrupting the stream.

Track the current object ID and compute the proper delta between
consecutive objects so downstream subscribers receive correct IDs.
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