mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-25 11:13:41 +00:00
Fix .well-known MatrixRTC transports fallback not kicking in for widgets (#34726)
This fallback code path was looking for the wrong error code (M_UNRECOGNIZED is the correct code for endpoints that a server does not implement, and is what Synapse returns on the transports endpoint in practice when msc4143_enabled is false).
This commit is contained in:
@@ -758,7 +758,7 @@ export class ElementWidgetDriver extends WidgetDriver {
|
||||
// If the homeserver does not support the API, fall back to legacy well-known lookup.
|
||||
if (
|
||||
e instanceof MatrixError &&
|
||||
e.errcode === "M_NOT_FOUND" &&
|
||||
e.errcode === "M_UNRECOGNIZED" &&
|
||||
SdkConfig.get("enable_client_well_known_lookups")
|
||||
) {
|
||||
const wellKnown = await client.waitForClientWellKnown();
|
||||
|
||||
@@ -462,7 +462,7 @@ describe("ElementWidgetDriver", () => {
|
||||
return sdkConfigGet(key, altCaseName);
|
||||
});
|
||||
client.cachedRtcTransports.wait.mockRejectedValue(
|
||||
new MatrixError({ errcode: "M_NOT_FOUND", error: "Not found" }, 404),
|
||||
new MatrixError({ errcode: "M_UNRECOGNIZED", error: "Not found" }, 404),
|
||||
);
|
||||
|
||||
await expect(driver.getRtcTransports()).rejects.toThrow();
|
||||
@@ -492,7 +492,7 @@ describe("ElementWidgetDriver", () => {
|
||||
return sdkConfigGet(key, altCaseName);
|
||||
});
|
||||
client.cachedRtcTransports.wait.mockRejectedValue(
|
||||
new MatrixError({ errcode: "M_NOT_FOUND", error: "Not found" }, 404),
|
||||
new MatrixError({ errcode: "M_UNRECOGNIZED", error: "Not found" }, 404),
|
||||
);
|
||||
|
||||
const transports = [{ type: "livekit", livekit_service_url: "https://livekit-jwt.example.com" }];
|
||||
|
||||
Reference in New Issue
Block a user