Skip to content

Commit

Permalink
Merge pull request #2620 from robintown/missing-members
Browse files Browse the repository at this point in the history
Diagnose the missing room members situation
  • Loading branch information
robintown committed Sep 11, 2024
2 parents 7e5b70d + ca135d4 commit 3df12be
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/room/GroupCallView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ export const GroupCallView: FC<Props> = ({
};
}, [rtcSession]);

useEffect(() => {
// Sanity check the room object
if (client.getRoom(rtcSession.room.roomId) !== rtcSession.room)
logger.warn(
`We've ended up with multiple rooms for the same ID (${rtcSession.room.roomId}). This indicates a bug in the group call loading code, and may lead to incomplete room state.`,
);
}, [client, rtcSession.room]);

const { displayName, avatarUrl } = useProfile(client);
const roomName = useRoomName(rtcSession.room);
const roomAvatar = useRoomAvatar(rtcSession.room);
Expand Down
8 changes: 7 additions & 1 deletion src/state/CallViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import {
ParticipantEvent,
RemoteParticipant,
} from "livekit-client";
import { Room as MatrixRoom, RoomMember } from "matrix-js-sdk/src/matrix";
import {
Room as MatrixRoom,
RoomMember,
RoomStateEvent,
} from "matrix-js-sdk/src/matrix";
import {
EMPTY,
Observable,
Expand Down Expand Up @@ -321,6 +325,8 @@ export class CallViewModel extends ViewModel {
this.remoteParticipants,
observeParticipantMedia(this.livekitRoom.localParticipant),
duplicateTiles.value,
// Also react to changes in the list of members
fromEvent(this.matrixRoom, RoomStateEvent.Update).pipe(startWith(null)),
]).pipe(
scan(
(
Expand Down

0 comments on commit 3df12be

Please sign in to comment.