When the connection drops, the client does not fail — it serves reads from its local
mirror, records writes in a local outbox, and shows the user exactly what has not
reached the server yet. When the connection returns, that queue is replayed safely.
1
Keep working
Reads come from the local mirror (IndexedDB on web and desktop, SQLite on mobile).
Writes are appended to a local outbox with a client-generated operation id and
applied to the UI immediately.
2
Show the state
A banner reports pending and failed counts with the time of the last successful
sync, so staff always know what is still only local.
3
Replay safely
On reconnect, on app foreground, on a timer, or on demand via a sync control, the
queue is replayed in order. Each operation carries an idempotency key, so a retry
cannot create a duplicate record.
4
Converge
Incremental pull deltas are merged into the local mirror, local-only ids are
remapped to server ids as records are created, and failures are retained in a
capped conflict log.