[players] Guard the review room against event feedback storms#2114
Open
frankrousseau wants to merge 1 commit into
Open
[players] Guard the review room against event feedback storms#2114frankrousseau wants to merge 1 commit into
frankrousseau wants to merge 1 commit into
Conversation
Rapidly changing shots in a review room made clients re-apply stale in-flight room updates and re-broadcast each other's states in a loop (cgwire#1574). Broadcasts are now muted while a remote state is applied, room-updated events carry a sequence number (riding inside local_id because the Zou relay only passes whitelisted fields through) so stale and out-of-order events are dropped, and outgoing bursts are throttled to a leading and a trailing emit. Payloads without a sequence keep the previous behavior for mixed-version rooms. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problems
updateRoomStatus(), so every applied update was re-broadcast and stale in-flight events kept re-applying old states.Solutions
room-updatedbroadcasts while a remote state is applied (and for a 500ms grace window so the deferred watcher/nextTick/time-update echo paths are covered) — an applied network state is never re-broadcast.local_id("<uuid>#<seq>", relayed verbatim) in addition to a first-classroom_seqfield for a future Zou pass-through; the existinglocal_idself-echo guard now compares the uuid prefix.local_idagainst their own plain uuid. Residual risk: an old client in a mixed-version room still lacks the re-broadcast mute, so a storm remains possible between two old clients; full arbitration would need a Zou-side sequence check.src/lib/players/roomSync.jswith unit tests (stale, out-of-order, missing-sequence, self-echo) plus composable-level tests for the mute, the stale drop and the burst throttle.