Skip to content

Commit

Permalink
Wait for .well-known/matrix/client to load before determining MatrixR…
Browse files Browse the repository at this point in the history
…TC foci (#2901)
  • Loading branch information
hughns authored Dec 16, 2024
1 parent a723f10 commit 92afd5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/rtcSessionHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test("It joins the correct Session", async () => {
room: {
roomId: "roomId",
client: {
getClientWellKnown: vi.fn().mockReturnValue(clientWellKnown),
waitForClientWellKnown: vi.fn().mockResolvedValue(clientWellKnown),
},
},
memberships: [],
Expand Down
5 changes: 3 additions & 2 deletions src/rtcSessionHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ async function makePreferredLivekitFoci(
}

// Prioritize the client well known over the configured sfu.
const wellKnownFoci =
rtcSession.room.client.getClientWellKnown()?.[FOCI_WK_KEY];
const wellKnownFoci = (
await rtcSession.room.client.waitForClientWellKnown()
)?.[FOCI_WK_KEY];
if (Array.isArray(wellKnownFoci)) {
preferredFoci.push(
...wellKnownFoci
Expand Down

0 comments on commit 92afd5d

Please sign in to comment.