From e28b98b256a30d9c006fba930ed16a962c50ab03 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Thu, 11 Dec 2025 18:24:12 +0000 Subject: [PATCH] improve comment --- .../CallViewModel/localMember/LocalTransport.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/state/CallViewModel/localMember/LocalTransport.ts b/src/state/CallViewModel/localMember/LocalTransport.ts index 7796124b..2869b33d 100644 --- a/src/state/CallViewModel/localMember/LocalTransport.ts +++ b/src/state/CallViewModel/localMember/LocalTransport.ts @@ -124,9 +124,10 @@ const FOCI_WK_KEY = "org.matrix.msc4143.rtc_foci"; * validating auth against the service to ensure it's correct. * Prefers in order: * - * 1. The transports returned via the homeserver. - * 2. The transports returned via .well-known. - * 3. The transport configured in Element Call's config. + * 1. The `urlFromDevSettings` value. If this cannot be validated, the function will throw. + * 2. The transports returned via the homeserver. + * 3. The transports returned via .well-known. + * 4. The transport configured in Element Call's config. * * @param client The authenticated Matrix client for the current user * @param roomId The ID of the room to be connected to. @@ -143,6 +144,14 @@ async function makeTransport( logger.trace("Searching for a preferred transport"); const livekitAlias = roomId; + // We will call `getSFUConfigWithOpenID` once per transport here as it's our + // only mechanism of valiation. This means we will also ask the + // homeserver for a OpenID token a few times. Since OpenID tokens are single + // use we don't want to risk any issues by re-using a token. + // + // If the OpenID request were to fail then it's acceptable for us to fail + // this function early, as we assume the homeserver has got some problems. + // DEVTOOL: Highest priority: Load from devtool setting if (urlFromDevSettings !== null) { logger.info("Using LiveKit transport from dev tools: ", urlFromDevSettings);