> ## Documentation Index
> Fetch the complete documentation index at: https://committ.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ResurrectionProvider

> System reset capability that triggers full client rebirth.

# 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

```typescript theme={null}
const { iteration, resurrect } = useResurrection();
```

| Field     | Type     | Purpose                                      |
| :-------- | :------- | :------------------------------------------- |
| iteration | number   | Counter that increments on each resurrection |
| resurrect | function | Triggers a full system reset                 |

***

## 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
