Chaos Store
Source:stores/useChaosStore.ts (1.8KB)
The useChaosStore is a development-only Zustand store used by the ChaosFab floating action button to inject controlled failures and test system resilience across all layers.
Capabilities
State Shape
Safety Guards
- The store is only accessible via the (dev)/chaos route
- The ChaosFab button only renders when DEV is true
- The (dev) route group is excluded from production builds via app.config.js
- All chaos actions are logged with [CHAOS] prefix for easy log filtering
Testing Strategy
The Chaos Store enables systematic resilience testing:- Corrupt Database → Verify Nuke and Pave triggers and HealOverlay appears
- Kill WebSocket → Verify ConnectionWatchdog (now HydrationSync) triggers resurrection
- Clear Sync Token → Verify Amnesia Mode performs full re-sync without data loss
- Trigger Resurrection → Verify ConvexClientWrapper correctly destroys old client and creates new one