Learn / Errors and failures
Sync: durable edits
A Sync edit is the user's intent, stored before it is sent, so its failures are different from a mutation's. See When things go wrong.
- Offline is not a failure. Edits keep applying and keep being saved;
status.pendinggrows, and the exchange retries on a backoff. A failed exchange setsstatus.lastError(cleared by the next success) and reportsExchangeFailed. - A rejected edit arrives on the next exchange, not as an error. The
replica drops it from the outbox and replays the rest, and the field reverts.
status.rejectedlists it with the operation and areason: theauthorizerule's own words when it gave some,Refused by the serverwhen it refused without any (a plainfalse), andNot a valid operationwhen the operation itself failed (validaterefused or threw,authorizethrew, or the reducer could not apply it). An error's message is never sent. - A persist that fails reverts the edit and calls
onPersistenceFailure, whose returned Model is what the reader sees next. The reader must redo it. - The outbox is user data, not a cache. Edits not yet committed live only there. Deleting local storage to "fix" a replica deletes them; evicted storage loses them the same way.