Sync engine — 0.6.0
This release ships the core sync infrastructure.
What's new
- 4-phase write invariant: validate → optimistic UI → atomic persist → push
- Dead-letter queue for mutations that fail more than 3 times
- Offline queue — writes while offline push automatically on reconnect
- Idempotent push via UUIDv7 mutation keys
Improvements
- Automatic rollback on push failure with pre-write snapshot
The 4-phase write invariant
Every write goes through four phases. If any phase fails, previous phases roll back automatically:
- Validate — Zod schema validation before touching storage
- Optimistic update — Zustand update for instant UI
- Atomic persist — IndexedDB transaction (entity + mutation record together)
- Push — Queue the mutation for server sync