Skip to content

Commit

Permalink
fix: Fixes showing left participants in the pane under certain condit…
Browse files Browse the repository at this point in the history
…ions.

Fixes #14491.
When a screensharing participant leaves and is unmuted or sharing the tab audio, there is a dominant speaker changed event which stores wrong values in filmstrip state. And because we skip reordering when there is no filmstrip scroll and no screensharers to avoid reordering on every dominant speaker event for small meetings, we fail to evaluate that the screensharere is actually gone and we still show it.
This will not happen if the one sharing is not dominant speaker (muted) or if there are more participants in the meeting (there is a scroll).
  • Loading branch information
damencho committed Mar 22, 2024
1 parent c0f9024 commit ffbaee0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions react/features/filmstrip/functions.any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ import { isFilmstripScrollVisible } from './functions';
* Computes the reorderd list of the remote participants.
*
* @param {*} store - The redux store.
* @param {boolean} force - Does not short circuit, the execution, make execute all checks.
* @param {string} participantId - The endpoint id of the participant that joined the call.
* @returns {void}
* @private
*/
export function updateRemoteParticipants(store: IStore, participantId?: string) {
export function updateRemoteParticipants(store: IStore, force?: boolean, participantId?: string) {
const state = store.getState();
let reorderedParticipants = [];
const { sortedRemoteVirtualScreenshareParticipants } = state['features/base/participants'];

if (!isFilmstripScrollVisible(state) && !sortedRemoteVirtualScreenshareParticipants.size) {
if (!isFilmstripScrollVisible(state) && !sortedRemoteVirtualScreenshareParticipants.size && !force) {
if (participantId) {
const { remoteParticipants } = state['features/filmstrip'];

Expand Down
2 changes: 1 addition & 1 deletion react/features/filmstrip/middleware.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MiddlewareRegistry.register(store => next => action => {
store.dispatch(setTileViewDimensions());
break;
case PARTICIPANT_JOINED: {
updateRemoteParticipants(store, action.participant?.id);
updateRemoteParticipants(store, false, action.participant?.id);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion react/features/filmstrip/middleware.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ MiddlewareRegistry.register(store => next => action => {
break;
}

updateRemoteParticipants(store, action.participant?.id);
updateRemoteParticipants(store, false, action.participant?.id);
break;
}
case SETTINGS_UPDATED: {
Expand Down
5 changes: 4 additions & 1 deletion react/features/filmstrip/subscriber.any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ StateListenerRegistry.register(

/**
* Listens for changes to the remote screenshare participants to recompute the reordered list of the remote endpoints.
* We force updateRemoteParticipants to make sure it executes and for the case where
* sortedRemoteVirtualScreenshareParticipants becomes 0. We do not want to short circuit it in case of no screen-sharers
* and no scroll and triggered for dominant speaker changed.
*/
StateListenerRegistry.register(
/* selector */ state => state['features/base/participants'].sortedRemoteVirtualScreenshareParticipants,
/* listener */ (sortedRemoteVirtualScreenshareParticipants, store) => updateRemoteParticipants(store));
/* listener */ (sortedRemoteVirtualScreenshareParticipants, store) => updateRemoteParticipants(store, true));

/**
* Listens for changes to the dominant speaker to recompute the reordered list of the remote endpoints.
Expand Down

0 comments on commit ffbaee0

Please sign in to comment.