From 0076b54e521e759d7b4a171e357a87e7bd2a851e Mon Sep 17 00:00:00 2001 From: Valere Date: Tue, 18 Nov 2025 12:14:17 +0100 Subject: [PATCH] minor comments/TODO cleaning --- src/state/CallViewModel/CallViewModel.ts | 9 +++------ .../CallViewModel/localMember/LocalMembership.ts | 11 ++++++++--- .../remoteMembers/MatrixMemberMetadata.test.ts | 2 -- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/state/CallViewModel/CallViewModel.ts b/src/state/CallViewModel/CallViewModel.ts index 22ab5e07..eb270641 100644 --- a/src/state/CallViewModel/CallViewModel.ts +++ b/src/state/CallViewModel/CallViewModel.ts @@ -371,8 +371,8 @@ export function createCallViewModel$( // For mocking purposes it is recommended to only mock the functions creating those outputs. // All other fields are just temp computations for the mentioned output. // The class does not need anything except the values underneath the bar. - // The creation of the values under the bar are all tested independently and testing the callViewModel Should - // not test their cretation. Call view model only needs: + // The creations of the values under the bar are all tested independently and testing the callViewModel Should + // not test their creation. Call view model only needs: // - memberships$ via createMemberships$ // - localMembership via createLocalMembership$ // - callLifecycle via createCallNotificationLifecycle$ @@ -438,7 +438,7 @@ export function createCallViewModel$( matrixRTCMode.value$.pipe( map((mode) => ({ encryptMedia: livekitKeyProvider !== undefined, - // TODO. This might need to get called again on each cahnge of matrixRTCMode... + // TODO. This might need to get called again on each change of matrixRTCMode... matrixRTCMode: mode, })), ), @@ -636,7 +636,6 @@ export function createCallViewModel$( /** * List of user media (camera feeds) that we want tiles for. */ - // TODO this also needs the local participant to be added. const userMedia$ = scope.behavior( combineLatest([ localMatrixLivekitMember$, @@ -1475,8 +1474,6 @@ export function createCallViewModel$( reconnecting$: reconnecting$, }; } -// TODO-MULTI-SFU // Setup and update the keyProvider which was create by `createRoom` was a thing before. Now we never update if the E2EEsystem changes -// do we need this? function getE2eeKeyProvider( e2eeSystem: EncryptionSystem, diff --git a/src/state/CallViewModel/localMember/LocalMembership.ts b/src/state/CallViewModel/localMember/LocalMembership.ts index 38d6092b..68b34d94 100644 --- a/src/state/CallViewModel/localMember/LocalMembership.ts +++ b/src/state/CallViewModel/localMember/LocalMembership.ts @@ -262,7 +262,7 @@ export const createLocalMembership$ = ({ ); const publisher$ = new BehaviorSubject(null); - localConnection$.subscribe((connection) => { + localConnection$.pipe(scope.bind()).subscribe((connection) => { if (connection !== null && publisher$.value === null) { // TODO looks strange to not change publisher if connection changes. publisher$.next( @@ -339,7 +339,7 @@ export const createLocalMembership$ = ({ }); combineLatest([localTransport$, connectRequested$]).subscribe( - // TODO reconnect on options change. + // TODO reconnect when transport changes => create test. ([transport, connectRequested]) => { if ( transport === null || @@ -573,7 +573,12 @@ interface EnterRTCSessionOptions { } /** - * TODO! document this function properly + * Does the necessary steps to enter the RTC session on the matrix side: + * - Preparing the membership info (FOCUS to use, options) + * - Sends the matrix event to join the call, and starts the membership manager: + * - Delay events management + * - Handles retries (fails only after several attempts) + * * @param rtcSession * @param transport * @param options diff --git a/src/state/CallViewModel/remoteMembers/MatrixMemberMetadata.test.ts b/src/state/CallViewModel/remoteMembers/MatrixMemberMetadata.test.ts index d27fe4c9..6f392351 100644 --- a/src/state/CallViewModel/remoteMembers/MatrixMemberMetadata.test.ts +++ b/src/state/CallViewModel/remoteMembers/MatrixMemberMetadata.test.ts @@ -104,7 +104,6 @@ describe("MatrixMemberMetadata", () => { } } - // TODO this is a regression, now there the own user is not always in the map. Ask Timo if fine it("should show our own user if present in rtc session and room", () => { withTestScheduler(({ behavior, expectObservable }) => { fakeMemberWith({ @@ -517,7 +516,6 @@ describe("MatrixMemberMetadata", () => { } } - // TODO this is a regression, now there the own user is not always in the map. Ask Timo if fine it("should use avatar url from room members", () => { withTestScheduler(({ behavior, expectObservable }) => { fakeMemberWith({