Learn / Errors and failures

Sync failures and rejected edits

Because Sync stores user intent locally before talking to a server, its failure states differ from Remote mutations (see When things go wrong):

  • Offline mode: Local edits keep saving to the outbox while status.pending counts up and exchanges retry with backoff. Failed exchanges set status.lastError and emit ExchangeFailed.
  • Rejected operations: When the server rejects an operation, the replica removes it from the outbox, replays remaining edits, and appends the rejection to status.rejected. authorize denials produce Forbidden; validate errors or reducer failures produce Invalid (Not a valid operation) without leaking server exception messages.
  • Storage write failure: If persisting to local storage fails, the edit reverts and onPersistenceFailure returns the fallback Model.
  • Outbox durability: Unsynced operations live only in browser storage; clearing local storage discards unsent work.