fix(moq-transport): compute correct object_id_delta in serve_subgroup#153
Open
thexeos wants to merge 1 commit intocloudflare:mainfrom
Open
fix(moq-transport): compute correct object_id_delta in serve_subgroup#153thexeos wants to merge 1 commit intocloudflare:mainfrom
object_id_delta in serve_subgroup#153thexeos wants to merge 1 commit intocloudflare:mainfrom
Conversation
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.
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.
In moq-transport/src/session/subscribed.rs, the
serve_subgroupmethod hardcodesobject_id_delta: 0for every object when re-serving subgroup data to downstream subscribers. Every object in a subgroup is received by downstream subscribers withobject_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 always0, 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_idaccumulator (starting at0) in the serving loop, then compute each delta asobject_id - current_object_id(matching the inverse of the decode logic in subscriber.rs:543).