Sync / Replicated state
The model
server: A B C committed, in the server's order
pending: D E this device's edits the server has not confirmed
visible: replay(A, B, C, D, E)When the server commits something else first, the base moves and the pending
edits are replayed on top; when it rejects D, D is dropped and E is
replayed. Both are the same move, a rebase. There is no undo function and
no separate optimistic store to patch.
An edit passes three milestones. A UI that says "saved" means the second; one that says "shared" means the third.
| Milestone | Where | Reader |
|---|---|---|
| visible | the Model, at once | the view |
| saved | the local outbox | onPersistenceFailure says when it is not |
| committed | the server journal | replica.status.pending, mounted.committed |