fix(filmstrip): sync remoteParticipants between itemKey and ThumbnailWrapper#17251
Open
JangJuMyeong wants to merge 1 commit intojitsi:masterfrom
Open
fix(filmstrip): sync remoteParticipants between itemKey and ThumbnailWrapper#17251JangJuMyeong wants to merge 1 commit intojitsi:masterfrom
JangJuMyeong wants to merge 1 commit intojitsi:masterfrom
Conversation
|
Hi, thanks for your contribution! |
Author
|
Hi, I've just signed the ICLA. Thanks for the heads up! |
…Wrapper Filmstrip._gridItemKey and _listItemKey reference this.props._remoteParticipants (captured at the parent's render time), but ThumbnailWrapper._mapStateToProps independently reads state['features/filmstrip'].remoteParticipants from Redux. When a participant joins or leaves between the parent render and the child's selector call, the two arrays can diverge, causing a tile keyed for participant A to actually render participant B's video. Pass _remoteParticipants through react-window's itemData so that ThumbnailWrapper uses the same array snapshot that the itemKey functions use, eliminating the race condition.
2c90780 to
e9803fd
Compare
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.
Summary
Fixes a race condition where the wrong participant's video is displayed in a tile.
Filmstrip._gridItemKey/_listItemKeyandThumbnailWrapper._mapStateToPropseach independently readremoteParticipants— the former fromthis.props(captured at the parent's render time), the latter directly from Redux state. When a participant joins or leaves between these two reads, the arrays diverge: a tile keyed for participant A ends up rendering participant B's video.How we found it
We operate a customized Jitsi Meet deployment serving ~200 users, where a manager oversees up to 50 participants simultaneously in tile view. With frequent join/leave activity at that scale, the mismatch became consistently reproducible.
Root cause
react-windowrenders child components (ThumbnailWrapper) independently from the parent (Filmstrip). The parent'sitemKeycallback captures_remoteParticipantsfrom its own render-cycle props, butThumbnailWrapper._mapStateToPropsreads a potentially newer snapshot from Redux. If the store updates between these two reads, index-to-participant mapping breaks.Fix
Pass
_remoteParticipantsthrough react-window'sitemDataprop so thatThumbnailWrapperuses the same array snapshot as theitemKeyfunctions. This is the intended use ofitemData— sharing parent-scoped data with virtualized children.Test plan