Sync / Replicated state
Lifecycle of a single edit
- Dispatched (
visible): The view dispatchesCreatedTodo({ id, title });updateupdatesModelimmediately. - Saved (
saved): The mount replays the edit and writes it to the local outbox inside Sync's envelope (opId,document,replica, local sequence,baseCursor). - Exchanged:
replica.startsends the pending envelope and cursor to the server. - Committed (
committed): The server runsvalidate,authorize,reduce, andlaws, assigns a global sequence and trustedactor, persists it, and returns the tail, acknowledgements, and rejections. - Rebased: The replica advances its committed base, drops acknowledged or rejected edits, replays any remaining pending edits, and updates
Model.