diff --git a/spec/unit/matrixrtc/MatrixRTCSession.spec.ts b/spec/unit/matrixrtc/MatrixRTCSession.spec.ts index b3a3e93f5..c12da728a 100644 --- a/spec/unit/matrixrtc/MatrixRTCSession.spec.ts +++ b/spec/unit/matrixrtc/MatrixRTCSession.spec.ts @@ -21,6 +21,7 @@ import { MatrixRTCSession, MatrixRTCSessionEvent } from "../../../src/matrixrtc/ import { type EncryptionKeysEventContent } from "../../../src/matrixrtc/types"; import { secureRandomString } from "../../../src/randomstring"; import { makeMockEvent, makeMockRoom, makeMockRoomState, membershipTemplate, makeKey } from "./mocks"; +import { RTCEncryptionManager } from "../../../src/matrixrtc/RTCEncryptionManager.ts"; const mockFocus = { type: "mock" }; @@ -1016,6 +1017,9 @@ describe("MatrixRTCSession", () => { await keySentPromise; expect(sendToDeviceMock).toHaveBeenCalled(); + + // Access private to test + expect(sess["encryptionManager"]).toBeInstanceOf(RTCEncryptionManager); } finally { jest.useRealTimers(); } diff --git a/src/matrixrtc/MatrixRTCSession.ts b/src/matrixrtc/MatrixRTCSession.ts index 692109ea6..2b6b6a279 100644 --- a/src/matrixrtc/MatrixRTCSession.ts +++ b/src/matrixrtc/MatrixRTCSession.ts @@ -443,17 +443,6 @@ export class MatrixRTCSession extends TypedEventEmitter< }, ); } - this.encryptionManager = new EncryptionManager( - this.client.getUserId()!, - this.client.getDeviceId()!, - () => this.memberships, - transport, - this.statistics, - (keyBin: Uint8Array, encryptionKeyIndex: number, participantId: string) => { - this.emit(MatrixRTCSessionEvent.EncryptionKeyChanged, keyBin, encryptionKeyIndex, participantId); - }, - this.logger, - ); } // Join!