From 9f6c8bb434202385a240bedf506beec3c5b6f9fe Mon Sep 17 00:00:00 2001 From: "Timo K." Date: Thu, 17 Sep 2026 13:44:25 +0200 Subject: [PATCH] Make the memberId dependent on the matrixRTC mode. This outherwise creates to-device messages with the uuid for members that use the userId:deviceId memberId in the state event. --- src/state/CallViewModel/CallViewModel.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/state/CallViewModel/CallViewModel.ts b/src/state/CallViewModel/CallViewModel.ts index 957a56fad..b2c763c2e 100644 --- a/src/state/CallViewModel/CallViewModel.ts +++ b/src/state/CallViewModel/CallViewModel.ts @@ -563,8 +563,14 @@ export function createCallViewModel$( const ownMembershipIdentity: CallMembershipIdentityParts = { userId, deviceId, - // This will only be consumed by the sticky membership manager. So it has no impact on legacy calls. - memberId: uuidv4(), + // Consumed by the sticky membership manager as `member.id`, *and* stamped + // into every to-device key event by the key transport. A pre-sticky + // membership advertises `${userId}:${deviceId}` as its `membershipID` + // instead, so a uuid there names a member no peer can resolve. + memberId: + matrixRTCMode === MatrixRTCMode.Matrix_2_0 + ? uuidv4() + : `${userId}:${deviceId}`, }; const localTransport =