Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
909d980
still with broken tests...
toger5 Dec 15, 2025
5bc6ed5
small refactor to make it testable.
toger5 Dec 15, 2025
3d8d0ae
Merge branch 'livekit' into toger5/pseudonomous-identities
toger5 Dec 15, 2025
6fe6dab
switch synapse docker image to one with sticky event support
fkwp Dec 16, 2025
ff3d6bd
enable sticky events
fkwp Dec 16, 2025
9bd51fd
Merge branch 'livekit' into toger5/pseudonomous-identities
toger5 Dec 16, 2025
ab7e348
Make use of the new jwt service endpoint (with delayed event delegation)
toger5 Dec 17, 2025
50f3bf0
use correct js-sdk
toger5 Dec 17, 2025
55d18f1
temp refactored membership rtcidentity
toger5 Dec 19, 2025
3ba2d13
use the js-sdk where the hashed rtcSessionIdeintity is already part of
toger5 Dec 28, 2025
7591e2b
Merge branch 'livekit' into toger5/delayed-event-delegation
toger5 Dec 28, 2025
0f5c5d8
cleanup based on new js-sdk impl
toger5 Dec 29, 2025
df2bd22
Merge branch 'livekit' into toger5/delayed-event-delegation
toger5 Jan 5, 2026
5d5d75e
fixup merge
toger5 Jan 5, 2026
00fca6e
simplify localTransport
toger5 Jan 5, 2026
1580087
use latest js-sdk
toger5 Jan 5, 2026
009c9e0
Merge branch 'livekit' into toger5/delayed-event-delegation
toger5 Jan 5, 2026
69a4189
self review
toger5 Jan 5, 2026
556a87d
fix js-doc
toger5 Jan 5, 2026
83d04ac
fix tests and remove duplicated mocks.
toger5 Jan 7, 2026
6480df4
add tests for open id delay fallback
toger5 Jan 7, 2026
d48042f
fix lint
toger5 Jan 7, 2026
dd562bd
dont use throw for logic.
toger5 Jan 7, 2026
d814f60
review (docstrings) and remove unused artifacts.
toger5 Jan 7, 2026
75fca31
cleanup an rename compatibility mode
toger5 Jan 7, 2026
d5ad2e3
fix up tests
toger5 Jan 7, 2026
0eeed4e
fix test snapshot
toger5 Jan 7, 2026
5556d36
add retries and be more specific when we fall back to legacy endpoint
toger5 Jan 7, 2026
a5a4bb2
add retries inside the `getLiveKitJWTWithDelayDelegation` and
toger5 Jan 7, 2026
385f63e
fix tests
toger5 Jan 7, 2026
1909aef
temp
toger5 Jan 8, 2026
d4b06b0
fix connection recreation which breaks EC lk connection
toger5 Jan 8, 2026
7dbbd76
Refactor how we aquire the jwt token for the local user. (only fetch it
toger5 Jan 9, 2026
c7c6dc1
fix js-sdk dependency
toger5 Jan 9, 2026
c2e3774
prettier
toger5 Jan 9, 2026
ed3d168
fix tests
toger5 Jan 9, 2026
3943231
use actual uuid for `member.id`
toger5 Jan 9, 2026
9a88e3d
review valere (more readable force new endpoint logic)
toger5 Jan 9, 2026
32694fd
improve rtcBackendIdentity debugging
toger5 Jan 9, 2026
7387a00
lint
toger5 Jan 9, 2026
1a9e4a1
bump js-sdk
toger5 Jan 9, 2026
735c17d
fix tile flicker on video mute/unmute
toger5 Jan 9, 2026
3412779
fix tests
toger5 Jan 9, 2026
47e3896
add uuid in our own package.json
toger5 Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 22 additions & 24 deletions src/state/CallViewModel/CallViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
} from "matrix-js-sdk/lib/matrixrtc";
import { type IWidgetApiRequest } from "matrix-widget-api";
import { type CallMembershipIdentityParts } from "matrix-js-sdk/lib/matrixrtc/EncryptionManager";
import { v4 as uuidv4 } from "uuid";

import {
LocalUserMediaViewModel,
Expand Down Expand Up @@ -430,9 +431,8 @@ export function createCallViewModel$(
const ownMembershipIdentity: CallMembershipIdentityParts = {
userId,
deviceId,
// This will eventually become the salt for the hash endpoint.
// For now we keep it as the user+device string since it is expected by non matrix matrixRTCMode === Legacy.
memberId: `${userId}:${deviceId}`,
// This will only be consumed by the sticky membership manager. So it has no impact on legacy calls.
memberId: uuidv4(),
};

const localTransport$ = createLocalTransport$({
Expand Down Expand Up @@ -722,22 +722,20 @@ export function createCallViewModel$(
if (localMatrixLivekitMember) {
const { userId, participant, connection$, membership$ } =
localMatrixLivekitMember;
localUserMediaId = `${userId}:${membership$.value.deviceId}`; // should be membership$.value.membershipID which is not optional

if (localUserMediaId) {
for (let dup = 0; dup < 1 + duplicateTiles; dup++) {
yield {
keys: [
dup,
localUserMediaId,
userId,
participant satisfies TaggedParticipant as TaggedParticipant, // Widen the type safely
connection$,
membership$.value,
],
data: undefined,
};
}

localUserMediaId = `${userId}:${membership$.value.deviceId}`;
for (let dup = 0; dup < 1 + duplicateTiles; dup++) {
yield {
keys: [
dup,
localUserMediaId,
userId,
participant satisfies TaggedParticipant as TaggedParticipant, // Widen the type safely
connection$,
membership$.value,
],
data: undefined,
};
}
}
// add remote members that are available
Expand All @@ -748,8 +746,8 @@ export function createCallViewModel$(
membership$,
} of matrixLivekitMembers.value) {
const userMediaId = `${userId}:${membership$.value.deviceId}`;
// skip local user as we added them manually before
if (userMediaId === localUserMediaId) continue;
// const participantId = membership$.value?.identity;
for (let dup = 0; dup < 1 + duplicateTiles; dup++) {
yield {
keys: [
Expand All @@ -769,7 +767,7 @@ export function createCallViewModel$(
scope,
_data$,
dup,
participantId,
userMediaId,
userId,
participant,
connection$,
Expand All @@ -789,7 +787,7 @@ export function createCallViewModel$(

return new UserMedia(
scope,
`${participantId}:${dup}`,
`${userMediaId}:${dup}`,
userId,
membership,
participant,
Expand All @@ -800,8 +798,8 @@ export function createCallViewModel$(
localMembership.reconnecting$,
displayName$,
matrixMemberMetadataStore.createAvatarUrlBehavior$(userId),
handsRaised$.pipe(map((v) => v[participantId]?.time ?? null)),
reactions$.pipe(map((v) => v[participantId] ?? undefined)),
handsRaised$.pipe(map((v) => v[userMediaId]?.time ?? null)),
reactions$.pipe(map((v) => v[userMediaId] ?? undefined)),
);
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function createMatrixLivekitMembers$({
filter((values) =>
values.every((value) => value.epoch === values[0].epoch),
),
map(([x, y]) => new Epoch([x.value, y.value] as const, x.epoch)),
map(([ms, data]) => new Epoch([ms.value, data.value] as const, ms.epoch)),
generateItemsWithEpoch(
// Generator function.
// creates an array of `{key, data}[]`
Expand Down