Merge pull request #2620 from robintown/missing-members

Diagnose the missing room members situation
This commit is contained in:
Robin 2024-09-11 09:33:42 -04:00 committed by GitHub
commit 3df12be95c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -85,6 +85,14 @@ export const GroupCallView: FC<Props> = ({
}; };
}, [rtcSession]); }, [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 { displayName, avatarUrl } = useProfile(client);
const roomName = useRoomName(rtcSession.room); const roomName = useRoomName(rtcSession.room);
const roomAvatar = useRoomAvatar(rtcSession.room); const roomAvatar = useRoomAvatar(rtcSession.room);

View File

@ -16,7 +16,11 @@ import {
ParticipantEvent, ParticipantEvent,
RemoteParticipant, RemoteParticipant,
} from "livekit-client"; } 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 { import {
EMPTY, EMPTY,
Observable, Observable,
@ -321,6 +325,8 @@ export class CallViewModel extends ViewModel {
this.remoteParticipants, this.remoteParticipants,
observeParticipantMedia(this.livekitRoom.localParticipant), observeParticipantMedia(this.livekitRoom.localParticipant),
duplicateTiles.value, duplicateTiles.value,
// Also react to changes in the list of members
fromEvent(this.matrixRoom, RoomStateEvent.Update).pipe(startWith(null)),
]).pipe( ]).pipe(
scan( scan(
( (