Wait for .well-known/matrix/client to load before determining MatrixRTC foci (#2901)

This commit is contained in:
Hugh Nimmo-Smith
2024-12-16 11:22:23 +00:00
committed by GitHub
parent a723f10d2c
commit 92afd5d63a
2 changed files with 4 additions and 3 deletions

View File

@@ -40,7 +40,7 @@ test("It joins the correct Session", async () => {
room: { room: {
roomId: "roomId", roomId: "roomId",
client: { client: {
getClientWellKnown: vi.fn().mockReturnValue(clientWellKnown), waitForClientWellKnown: vi.fn().mockResolvedValue(clientWellKnown),
}, },
}, },
memberships: [], memberships: [],

View File

@@ -44,8 +44,9 @@ async function makePreferredLivekitFoci(
} }
// Prioritize the client well known over the configured sfu. // Prioritize the client well known over the configured sfu.
const wellKnownFoci = const wellKnownFoci = (
rtcSession.room.client.getClientWellKnown()?.[FOCI_WK_KEY]; await rtcSession.room.client.waitForClientWellKnown()
)?.[FOCI_WK_KEY];
if (Array.isArray(wellKnownFoci)) { if (Array.isArray(wellKnownFoci)) {
preferredFoci.push( preferredFoci.push(
...wellKnownFoci ...wellKnownFoci