From 04ccaf3e781fe989f6f448823438cd419f421783 Mon Sep 17 00:00:00 2001 From: Sedat Qaja Date: Wed, 21 Oct 2026 18:37:21 +0200 Subject: [PATCH] fix(calls): ship LiveKit fallback in Element Call config Well-known fetch fails CORS on IPv4 (Wix redirect), so the embedded widget needs the JWT service URL in its own config.json. --- apps/web/res/element-call-config.json | 10 ++++++++++ apps/web/webpack.config.ts | 12 ++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 apps/web/res/element-call-config.json diff --git a/apps/web/res/element-call-config.json b/apps/web/res/element-call-config.json new file mode 100644 index 0000000000..78c042218c --- /dev/null +++ b/apps/web/res/element-call-config.json @@ -0,0 +1,10 @@ +{ + "matrix_rtc_session": { + "wait_for_key_rotation_ms": 5000, + "delayed_leave_event_restart_ms": 4000, + "delayed_leave_event_delay_ms": 18000 + }, + "livekit": { + "livekit_service_url": "https://matrix.healthchat.ch/livekit-jwt-service" + } +} diff --git a/apps/web/webpack.config.ts b/apps/web/webpack.config.ts index 3017e1c6e8..60182b6b7c 100644 --- a/apps/web/webpack.config.ts +++ b/apps/web/webpack.config.ts @@ -728,6 +728,18 @@ export default (env: string, argv: Record): webpack.Configuration = context: path.join(getPackageRoot("@element-hq/element-call-embedded"), "dist"), to: path.join(__dirname, "webapp", "widgets", "element-call"), }, + // HealthChat: overwrite the embedded Element Call config with one that carries a + // LiveKit fallback. Element Call fetches https://healthchat.ch/.well-known/matrix/client + // itself from the widget origin; over IPv4 that host is served by Wix, which answers + // a 301 to matrix.healthchat.ch without an Access-Control-Allow-Origin header, so + // the fetch fails CORS on IPv4-only networks and Element Call falls back to this + // file. Without the livekit block it errors with MISSING_MATRIX_RTC_TRANSPORT. + // Keep the matrix_rtc_session timers in sync with what the package ships. + { + from: "res/element-call-config.json", + to: path.join(__dirname, "webapp", "widgets", "element-call", "config.json"), + force: true, + }, // Mobile guide assets { from: "assets/**",