feat: crash recovery — global error handlers + toast + burst-reload

- lib/crashRecovery.ts: window.onerror + unhandledrejection handlers,
  dedupe identical messages within 10s, burst-reload after 8 distinct
  errors in 30s
- components/CrashToast.tsx: portal stack in bottom-right, max 3 visible,
  auto-dismiss after 7s, per-entry close button
- Wired in main.tsx before bootstrap so crypto/i18n errors are captured,
  rendered from App.tsx alongside UpdateToast

Covers the async layer ErrorBoundary misses (realtime handlers, stray
Promises, setTimeout callbacks, LiveKit listeners).
This commit is contained in:
2026-04-21 09:29:01 +02:00
parent 672c8738c7
commit 636565d552
4 changed files with 201 additions and 0 deletions
+2
View File
@@ -1,6 +1,7 @@
import { BrowserRouter, Navigate, Outlet, Route, Routes } from 'react-router-dom';
import { AppShell } from './components/AppShell';
import { CrashToast } from './components/CrashToast';
import { ErrorBoundary } from './components/ErrorBoundary';
import { UpdateToast } from './components/UpdateToast';
import { RequireAdmin, RequireAuth, RequireDevice } from './components/guards';
@@ -91,6 +92,7 @@ export function App() {
<Route path="*" element={<Navigate to="/chats" replace />} />
</Routes>
<UpdateToast />
<CrashToast />
</BrowserRouter>
</CallProvider>
</ConversationsProvider>