diff --git a/src/ClientContext.tsx b/src/ClientContext.tsx index 8ba26b4..8bd0412 100644 --- a/src/ClientContext.tsx +++ b/src/ClientContext.tsx @@ -258,7 +258,11 @@ export const ClientProvider: FC = ({ children }) => { }, [history]); useEffect(() => { - if (client) { + // To protect against multiple sessions writing to the same storage + // simultaneously, we send a to-device message that shuts down all other + // running instances of the app. This isn't necessary if the app is running + // in a widget though, since then it'll be mostly stateless. + if (!widget && client) { const loadTime = Date.now(); const onToDeviceEvent = (event: MatrixEvent) => { diff --git a/src/widget.ts b/src/widget.ts index b6e7b98..c0cdde9 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -106,7 +106,6 @@ export const widget: WidgetHelpers | null = (() => { EventType.CallSDPStreamMetadataChanged, EventType.CallSDPStreamMetadataChangedPrefix, EventType.CallReplaces, - "org.matrix.call_duplicate_session", ]; const client = createRoomWidgetClient(