Add enableClientWellKnownLookups

Gate client well-known lookups on enableClientWellKnownLookups

New URL param (default on), threaded from the embedder. When off, always
avoid client .well-known: skip the post-login poll (widget + SPA) and the
legacy MatrixRTC foci fallback. When on/unset, respect the transports
endpoint response: only fall back to .well-known on a 404 M_UNRECOGNIZED.
This commit is contained in:
David Langley
2026-07-10 18:49:10 +01:00
parent 59999b9b37
commit 23a9e0c85e
6 changed files with 212 additions and 74 deletions

View File

@@ -82,6 +82,7 @@ export const initializeWidget = (
baseUrl,
e2eEnabled,
allowIceFallback,
enableClientWellKnownLookups,
} = getUrlParams();
if (!roomId) throw new Error("Room ID must be supplied");
@@ -195,7 +196,13 @@ export const initializeWidget = (
// Wait for the config file to be ready (we load very early on so it might not
// be otherwise)
await Config.init();
await client.startClient({ clientWellKnownPollPeriod: 60 * 10 });
// Leaving `clientWellKnownPollPeriod` unset stops the SDK polling the
// homeserver's `server_name` `.well-known` after login.
await client.startClient({
clientWellKnownPollPeriod: enableClientWellKnownLookups
? 60 * 10
: undefined,
});
return client;
};