[FCE-3270] fix(ts-client): serialize receiveMediaEvent calls#528
Closed
Critteros wants to merge 4 commits into
Closed
[FCE-3270] fix(ts-client): serialize receiveMediaEvent calls#528Critteros wants to merge 4 commits into
Critteros wants to merge 4 commits into
Conversation
Chain receiveMediaEvent invocations through a single promise so incoming server media events are processed in order. Prevents race when multiple events arrive concurrently. Chain reset on disconnect
czerwiukk
approved these changes
May 6, 2026
Co-authored-by: adrian <33912477+czerwiukk@users.noreply.github.com>
MiloszFilimowski
requested changes
May 6, 2026
MiloszFilimowski
left a comment
Collaborator
There was a problem hiding this comment.
we already have a similar queue in webRTCEndpoint.ts so this won't solve the issue.
Collaborator
|
we already have a similar queue in webRTCEndpoint.ts so this won't solve the issue. |
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.
Description
Serialize
receiveMediaEventcalls inFishjamClientby chaining them through a single promise (receiveMediaEventChain). Each incoming server media event waits for the previous one to settle beforebeing passed to
webrtc.receiveMediaEvent. The chain is reset on disconnect.Motivation and Context
Server media events were dispatched to the WebRTC layer the moment they arrived, with no ordering guarantee between handlers. When
receiveMediaEventdid asynchronous work, concurrent events couldinterleave and produce out-of-order state updates. Chaining ensures events are applied in the order they were received.
Documentation impact
Types of changes
not work as expected)