ResurrectionProvider
The ResurrectionProvider (providers/ResurrectionProvider.tsx) is the outermost provider in the app tree. It provides a catastrophic failure recovery mechanism by exposing an iteration counter that triggers a full client rebirth.API
How It Works
When resurrect() is called, the iteration counter increments. The ConvexClientWrapper consumes this counter via useMemo, which causes the Convex client to be destroyed and re-created. The old client’s WebSocket and file descriptors are explicitly closed to prevent WAL corruption.Trigger Conditions
- Database corruption detected by the Sync Engine
- WebSocket connection permanently dead (ConnectionWatchdog)
- Manual trigger via ChaosStore during development
- Unrecoverable state detected by any system component