Skip to content

fix(filmstrip): sync remoteParticipants between itemKey and ThumbnailWrapper#17251

Open
JangJuMyeong wants to merge 1 commit intojitsi:masterfrom
JangJuMyeong:fix/filmstrip-thumbnail-participant-sync
Open

fix(filmstrip): sync remoteParticipants between itemKey and ThumbnailWrapper#17251
JangJuMyeong wants to merge 1 commit intojitsi:masterfrom
JangJuMyeong:fix/filmstrip-thumbnail-participant-sync

Conversation

@JangJuMyeong
Copy link
Copy Markdown

Summary

Fixes a race condition where the wrong participant's video is displayed in a tile. Filmstrip._gridItemKey / _listItemKey and ThumbnailWrapper._mapStateToProps each independently read remoteParticipants — the former from this.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-window renders child components (ThumbnailWrapper) independently from the parent (Filmstrip). The parent's itemKey callback captures _remoteParticipants from its own render-cycle props, but ThumbnailWrapper._mapStateToProps reads a potentially newer snapshot from Redux. If the store updates between these two reads, index-to-participant mapping breaks.

Fix

Pass _remoteParticipants through react-window's itemData prop so that ThumbnailWrapper uses the same array snapshot as the itemKey functions. This is the intended use of itemData — sharing parent-scoped data with virtualized children.

Test plan

  • Join a tile-view call with 3+ participants
  • Have participants rapidly join and leave
  • Verify each tile consistently shows the correct participant's video and name

@jitsi-jenkins
Copy link
Copy Markdown

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

@JangJuMyeong
Copy link
Copy Markdown
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.
@JangJuMyeong JangJuMyeong force-pushed the fix/filmstrip-thumbnail-participant-sync branch from 2c90780 to e9803fd Compare March 31, 2026 00:46
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.

3 participants