From 45fd7fdc7fbcdf6fdb22bf6c9524b0dccdb9cad4 Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 4 Jun 2025 15:52:45 -0400 Subject: [PATCH] Always render audio from the current set of participants We forgot to tell React that we need the audio renderer to react to changes in the set of MatrixRTC participants; instead we had it referencing rtcSession.memberships non-reactively. Now, I'm not 100% confident that this is going to fix the "speaking from the void" issues observed in the wild, because I can't reproduce them and, in my testing, the InCallView component always seemed to be rendered redundantly when the MatrixRTC participants change, even though we hadn't explicitly stated that it needs to react. (This makes sense as we haven't memoized the component.) But it's worth a shot. --- src/room/InCallView.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index b9655d37..2b80e6b1 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -104,6 +104,7 @@ import { ConnectionLostError } from "../utils/errors.ts"; import { useTypedEventEmitter } from "../useEvents.ts"; import { MatrixAudioRenderer } from "../livekit/MatrixAudioRenderer.tsx"; import { muteAllAudio$ } from "../state/MuteAllAudioModel.ts"; +import { useMatrixRTCSessionMemberships } from "../useMatrixRTCSessionMemberships.ts"; const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {}); @@ -250,6 +251,7 @@ export const InCallView: FC = ({ useExperimentalToDeviceTransportSetting, ); const encryptionSystem = useRoomEncryptionSystem(rtcSession.room.roomId); + const memberships = useMatrixRTCSessionMemberships(rtcSession); const showToDeviceEncryption = useMemo( () => @@ -723,10 +725,7 @@ export const InCallView: FC = ({ ) } - + {renderContent()}