From d18e82c54674289f73236c0107d9c2f7d0de850b Mon Sep 17 00:00:00 2001 From: "Timo K." Date: Tue, 8 Sep 2026 15:00:49 +0200 Subject: [PATCH] Catch the component's errors inside the component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only the call body sat inside an error boundary; anything thrown in the lobby, the mute state or the providers propagated into the host's React tree, where React unmounts everything up to the nearest boundary — the host's, or the host's whole application. The standalone app has a boundary at its top; the component now has the same, showing the error page inside its container and asking the host to stop keeping it on screen. Co-Authored-By: Claude Fable 5.1 --- component/index.tsx | 46 +++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/component/index.tsx b/component/index.tsx index 75420d0f1..5a0be5d12 100644 --- a/component/index.tsx +++ b/component/index.tsx @@ -45,11 +45,13 @@ import { logger } from "matrix-js-sdk/lib/logger"; import { MemoryRouter } from "react-router-dom"; import { I18nextProvider } from "react-i18next"; import { TooltipProvider } from "@vector-im/compound-web"; +import { ErrorBoundary } from "@sentry/react"; import { shouldPolyfill as shouldPolyfillSegmenter } from "@formatjs/intl-segmenter/should-polyfill"; import { shouldPolyfill as shouldPolyfillDurationFormat } from "@formatjs/intl-durationformat/should-polyfill.js"; import EN from "../locales/en/app.json"; import { ElementCallView } from "../src/ElementCallView"; +import { ErrorPage } from "../src/FullScreenView"; import { ClientProvider } from "../src/ClientContext"; import { type HostBridge, @@ -265,24 +267,32 @@ export const ElementCall: FC = ({ rtcSession !== null && mediaDevices !== null && ( - - - - - - - - - - - + {/* Whatever goes wrong in here is shown in here. Left to + propagate, an error would unmount the host's own tree. */} + } + // A broken call should not hold the host on screen + onError={() => void hostBridge.setAlwaysOnScreen(false)} + > + + + + + + + + + + + + )}