Match LiveKit participants against all backend identities

A member authenticated through the legacy JWT endpoint publishes under a
`user:device` identity, while one authenticated through the default
endpoint publishes under a hashed identity. Both are listed in the
membership's backend identities, so match against the whole list rather
than only the primary one.
This commit is contained in:
Robin
2026-10-12 10:04:47 +02:00
committed by Johannes Marbach
parent d8becaf868
commit 3f030e64dd
2 changed files with 6 additions and 5 deletions
@@ -111,8 +111,8 @@ export function createRemoteMatrixLivekitMembers$({
const participants = transport const participants = transport
? managerData.getParticipantsForTransport(transport) ? managerData.getParticipantsForTransport(transport)
: []; : [];
const matches = participants.filter( const matches = participants.filter((p) =>
(p) => p.identity == membership.rtcBackendIdentity, membership.backendIdentities.includes(p.identity),
); );
const participant = matches[0] ?? null; const participant = matches[0] ?? null;
const connection = transport const connection = transport
+4 -3
View File
@@ -261,11 +261,12 @@ export function mockRtcMembership(
content: data, content: data,
}); });
const membershipData = CallMembership.membershipDataFromMatrixEvent(event); const backendIdentity = rtcBackendIdentity ?? `${userId}:${deviceId}`;
const cms = new CallMembership( const cms = new CallMembership(
event, event,
membershipData, CallMembership.membershipDataFromMatrixEvent(event),
rtcBackendIdentity ?? `${userId}:${deviceId}`, [backendIdentity],
backendIdentity,
); );
vi.mocked(cms).getTransport = vi.fn().mockReturnValue(fociPreferred[0]); vi.mocked(cms).getTransport = vi.fn().mockReturnValue(fociPreferred[0]);