Base JWT service endpoint choice directly on the MatrixRTC mode

Since we removed the extra 'legacy' mode, meaning there's nothing simplified anymore by translating things over to a JWT service version.

(Also, simplify some things by making the mode static for the duration of a call.)
This commit is contained in:
Robin
2026-09-08 21:22:52 +02:00
parent d38daef567
commit 5cfe7ea4df
10 changed files with 58 additions and 115 deletions
@@ -41,6 +41,7 @@ import {
import * as openIDSFU from "../../../livekit/openIDSFU";
import { customLivekitUrl } from "../../../settings/settings";
import { testJWTToken } from "../../../utils/test-fixtures";
import { MatrixRTCMode } from "../../../config/ConfigOptions";
describe("LocalTransport", () => {
const openIdResponse: openIDSFU.SFUConfig = {
@@ -67,7 +68,7 @@ describe("LocalTransport", () => {
getDeviceId: vi.fn(),
},
ownMembershipIdentity: ownMemberMock,
forceJwtEndpoint: JwtEndpointVersion.Legacy,
matrixRTCMode: MatrixRTCMode.Compatibility,
delayId$: constant("delay_id_mock"),
});
await flushPromises();
@@ -108,7 +109,7 @@ describe("LocalTransport", () => {
getDeviceId: vi.fn(),
},
ownMembershipIdentity: ownMemberMock,
forceJwtEndpoint: JwtEndpointVersion.Legacy,
matrixRTCMode: MatrixRTCMode.Compatibility,
delayId$: constant("delay_id_mock"),
});
active$.subscribe(
@@ -150,7 +151,7 @@ describe("LocalTransport", () => {
baseUrl: "https://example.org",
},
ownMembershipIdentity: ownMemberMock,
forceJwtEndpoint: JwtEndpointVersion.Legacy,
matrixRTCMode: MatrixRTCMode.Compatibility,
delayId$: constant("delay_id_mock"),
});
@@ -194,7 +195,7 @@ describe("LocalTransport", () => {
ownMembershipIdentity: ownMemberMock,
scope: testScope(),
roomId: "!example_room_id",
forceJwtEndpoint: JwtEndpointVersion.Legacy,
matrixRTCMode: MatrixRTCMode.Compatibility,
delayId$: constant(null),
memberships$: constant(new Epoch<CallMembership[]>([])),
client: {
@@ -306,7 +307,7 @@ describe("LocalTransport", () => {
scope: testScope(),
ownMembershipIdentity: ownMemberMock,
roomId: "!example_room_id",
forceJwtEndpoint: JwtEndpointVersion.Legacy,
matrixRTCMode: MatrixRTCMode.Compatibility,
delayId$: constant(null),
memberships$: constant(new Epoch<CallMembership[]>([])),
client: {