The network is never in the way of the work
Every write goes into IndexedDB and returns immediately; the outbox syncs later, or in a week. There is no spinner between an engineer and a form, because the moment there is one, the form gets filled in on paper and typed up wrong that evening.
local first · sync second
Every write carries an id made on the device
A patchy tunnel means the same batch is sent twice, or — worse — the reply is lost after the server applied it, so the device has no way of knowing it succeeded. The id is generated before the request leaves, so the replay returns the original result instead of a second inspection. Press Lose the next reply, change an answer, and watch the automatic retry come back duplicate.
idempotency · not hope
Conflicts are per field, and they are evidence
Each write carries the version it was based on, so the server can tell a real conflict from a stale echo — and only for the field that actually moved. Two people answering different questions is not a conflict. The value that loses is written to the record, never dropped.
three-way, field by field
It really installs
A service worker precaches the shell, so it opens from the home screen with the aeroplane mode switch on and no network stack underneath it. That is the difference between a website that copes with a bad connection and an app that does not need one.
service worker · manifest · standalone