Reset matrix-js-sdk to develop branch, adopt new join/leave signatures

This commit is contained in:
Robin
2026-10-01 17:11:24 +02:00
parent 9e190e9e57
commit d5733e8274
5 changed files with 18 additions and 21 deletions
+1 -1
View File
@@ -103,7 +103,7 @@
"livekit-client": "^2.18.1", "livekit-client": "^2.18.1",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"loglevel": "^1.9.1", "loglevel": "^1.9.1",
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#robin/remove-oldest-membership", "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
"matrix-widget-api": "^1.18.0", "matrix-widget-api": "^1.18.0",
"node-stdlib-browser": "^1.3.1", "node-stdlib-browser": "^1.3.1",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
+5 -5
View File
@@ -191,8 +191,8 @@ importers:
specifier: ^1.9.1 specifier: ^1.9.1
version: 1.9.2 version: 1.9.2
matrix-js-sdk: matrix-js-sdk:
specifier: github:matrix-org/matrix-js-sdk#robin/remove-oldest-membership specifier: github:matrix-org/matrix-js-sdk#develop
version: https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/6defa47adae28feb7e3906dde25089e0dce42ece version: https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/fa4772a4ddd335a5a8bfbf8bb21df49b70f7a999
matrix-widget-api: matrix-widget-api:
specifier: ^1.18.0 specifier: ^1.18.0
version: 1.19.0 version: 1.19.0
@@ -4680,8 +4680,8 @@ packages:
matrix-events-sdk@0.0.1: matrix-events-sdk@0.0.1:
resolution: {integrity: sha512-1QEOsXO+bhyCroIe2/A5OwaxHvBm7EsSQ46DEDn8RBIfQwN5HWBpFvyWWR4QY0KHPPnnJdI99wgRiAl7Ad5qaA==} resolution: {integrity: sha512-1QEOsXO+bhyCroIe2/A5OwaxHvBm7EsSQ46DEDn8RBIfQwN5HWBpFvyWWR4QY0KHPPnnJdI99wgRiAl7Ad5qaA==}
matrix-js-sdk@https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/6defa47adae28feb7e3906dde25089e0dce42ece: matrix-js-sdk@https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/fa4772a4ddd335a5a8bfbf8bb21df49b70f7a999:
resolution: {gitHosted: true, integrity: sha512-jHFmI2C29HJnzs/FIrqdmQD6ytyunyy627onhrxI+xxTGSfYrWhcTUFstNiCAaMt3fc0nNi9aVvLPD3IIglF2A==, tarball: https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/6defa47adae28feb7e3906dde25089e0dce42ece} resolution: {gitHosted: true, integrity: sha512-qF8++74MX36KS1KEw6Lc8HHXgZ6nHD1oUU4yBZUj5vVPvZTIspk1lOGztkFmizE5vmLAHd5tdadL9Xu1Asy4bA==, tarball: https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/fa4772a4ddd335a5a8bfbf8bb21df49b70f7a999}
version: 42.3.0 version: 42.3.0
engines: {node: '>=22.0.0'} engines: {node: '>=22.0.0'}
@@ -10249,7 +10249,7 @@ snapshots:
matrix-events-sdk@0.0.1: {} matrix-events-sdk@0.0.1: {}
matrix-js-sdk@https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/6defa47adae28feb7e3906dde25089e0dce42ece: matrix-js-sdk@https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/fa4772a4ddd335a5a8bfbf8bb21df49b70f7a999:
dependencies: dependencies:
'@babel/runtime': 8.0.0 '@babel/runtime': 8.0.0
'@matrix-org/matrix-sdk-crypto-wasm': 18.9.0 '@matrix-org/matrix-sdk-crypto-wasm': 18.9.0
@@ -138,7 +138,7 @@ describe("enterRTCSession", () => {
client: mockedClient, client: mockedClient,
}, },
memberships: [], memberships: [],
joinRTCSession: vi.fn(), join: vi.fn(),
}) as unknown as MatrixRTCSession; }) as unknown as MatrixRTCSession;
beforeEach(() => beforeEach(() =>
@@ -150,7 +150,7 @@ describe("enterRTCSession", () => {
it("It joins the correct Session", () => { it("It joins the correct Session", () => {
enterRTCSession(mockedSession, ownMemberMock, transport, options); enterRTCSession(mockedSession, ownMemberMock, transport, options);
expect(mockedSession.joinRTCSession).toHaveBeenLastCalledWith( expect(mockedSession.join).toHaveBeenLastCalledWith(
{ {
deviceId: "DEVICE", deviceId: "DEVICE",
memberId: "@alice:example.org:DEVICE", memberId: "@alice:example.org:DEVICE",
@@ -161,7 +161,7 @@ describe("enterRTCSession", () => {
); );
}); });
it("passes keyRotationParticipantLimit from config to joinRTCSession", () => { it("passes keyRotationParticipantLimit from config to join", () => {
mockConfig({ mockConfig({
livekit: { livekit_service_url: "http://my-default-service-url.com" }, livekit: { livekit_service_url: "http://my-default-service-url.com" },
matrix_rtc_session: { matrix_rtc_session: {
@@ -174,7 +174,7 @@ describe("enterRTCSession", () => {
enterRTCSession(mockedSession, ownMemberMock, transport, options); enterRTCSession(mockedSession, ownMemberMock, transport, options);
expect(mockedSession.joinRTCSession).toHaveBeenLastCalledWith( expect(mockedSession.join).toHaveBeenLastCalledWith(
expect.any(Object), expect.any(Object),
expect.any(Object), expect.any(Object),
expect.objectContaining({ expect.objectContaining({
@@ -186,7 +186,7 @@ describe("enterRTCSession", () => {
it("uses the specified delayed leave timings", () => { it("uses the specified delayed leave timings", () => {
enterRTCSession(mockedSession, ownMemberMock, transport, options); enterRTCSession(mockedSession, ownMemberMock, transport, options);
expect(mockedSession.joinRTCSession).toHaveBeenLastCalledWith( expect(mockedSession.join).toHaveBeenLastCalledWith(
expect.anything(), expect.anything(),
expect.anything(), expect.anything(),
expect.objectContaining({ expect.objectContaining({
@@ -206,7 +206,7 @@ describe("LocalMembership", () => {
}), }),
matrixRTCSession: { matrixRTCSession: {
updateCallIntent: vi.fn().mockReturnValue(Promise.resolve()), updateCallIntent: vi.fn().mockReturnValue(Promise.resolve()),
leaveRoomSession: vi.fn(), leave: vi.fn(),
} as unknown as MatrixRTCSession, } as unknown as MatrixRTCSession,
muteStates: mockMuteStates(), muteStates: mockMuteStates(),
trackProcessorState$: constant({ trackProcessorState$: constant({
@@ -300,7 +300,7 @@ describe("LocalMembership", () => {
...defaultCreateLocalMemberValues, ...defaultCreateLocalMemberValues,
matrixRTCSession: { matrixRTCSession: {
updateCallIntent: vi.fn().mockImplementation(reject), updateCallIntent: vi.fn().mockImplementation(reject),
leaveRoomSession: vi.fn(), leave: vi.fn(),
}, },
connectionManager: mockConnectionManager, connectionManager: mockConnectionManager,
localTransport$: constant(mockTransport), localTransport$: constant(mockTransport),
@@ -151,10 +151,7 @@ interface Props {
ownMembershipIdentity: CallMembershipIdentityParts; ownMembershipIdentity: CallMembershipIdentityParts;
localTransport$: Observable<LocalTransport>; localTransport$: Observable<LocalTransport>;
client: Pick<MatrixClient, "getDeviceId" | "getOpenIdToken">; client: Pick<MatrixClient, "getDeviceId" | "getOpenIdToken">;
matrixRTCSession: Pick< matrixRTCSession: Pick<MatrixRTCSession, "updateCallIntent" | "leave">;
MatrixRTCSession,
"updateCallIntent" | "leaveRoomSession"
>;
/** Whether to hide the screen-sharing button. */ /** Whether to hide the screen-sharing button. */
hideScreensharing: boolean; hideScreensharing: boolean;
/** The application hosting Element Call, to be kept informed of join/leave. */ /** The application hosting Element Call, to be kept informed of join/leave. */
@@ -682,7 +679,7 @@ export const createLocalMembership$ = ({
return Promise.resolve(async (): Promise<void> => { return Promise.resolve(async (): Promise<void> => {
try { try {
// TODO Update matrixRTCSession to allow udpating the transport without leaving the session! // TODO Update matrixRTCSession to allow udpating the transport without leaving the session!
await matrixRTCSession.leaveRoomSession(1000); await matrixRTCSession.leave(1000);
} catch (e) { } catch (e) {
logger.error("Error leaving RTC session", e); logger.error("Error leaving RTC session", e);
} }
@@ -998,7 +995,7 @@ export function enterRTCSession(
// Multi-sfu does not need a preferred foci list. just the focus that is actually used. // Multi-sfu does not need a preferred foci list. just the focus that is actually used.
// TODO where/how do we track errors originating from the ongoing rtcSession? // TODO where/how do we track errors originating from the ongoing rtcSession?
rtcSession.joinRTCSession(ownMembershipIdentity, [transport], { rtcSession.join(ownMembershipIdentity, [transport], {
notificationType, notificationType,
callIntent, callIntent,
manageMediaKeys: encryptMedia, manageMediaKeys: encryptMedia,
+2 -2
View File
@@ -472,7 +472,7 @@ export class MockRTCSession extends TypedEventEmitter<
counters: {}, counters: {},
}; };
public leaveRoomSession: ReturnType<typeof vitest.fn> = vitest public leave: ReturnType<typeof vitest.fn> = vitest
.fn() .fn()
.mockResolvedValue(undefined); .mockResolvedValue(undefined);
@@ -531,7 +531,7 @@ export class MockRTCSession extends TypedEventEmitter<
if (value !== prev) this.emit(MembershipManagerEvent.ProbablyLeft, value); if (value !== prev) this.emit(MembershipManagerEvent.ProbablyLeft, value);
} }
public async joinRTCSession(): Promise<void> { public async join(): Promise<void> {
return Promise.resolve(); return Promise.resolve();
} }
} }