Offline is not a feature you add. It is a decision about where the truth lives.
A medical representative in a waiting room, a picker in a steel-clad warehouse, an engineer in a basement plant room. Their work does not stop when the bars do, and an app that spins a loader is an app they stop using. Offline-first changes the data model, the sync, the conflict rules and the testing — which is why retrofitting it costs more than building it.
Most apps treat the server as authoritative and the device as a window onto it. Offline-first inverts that for the duration of the user’s work: the device holds the truth about what they have just done, and the server finds out afterwards. That inversion reaches into the data model, the state management, the API design and the testing strategy, which is why it is a decision made in the first sprint or paid for twice.
The tell for a retrofit is a loading spinner that appears where a cached value should have been.
A call is logged in a waiting room, a basement clinic or a rural town. The visit is the product; losing it to a dropped connection loses the day’s work and the rep’s trust in the tool.
Steel racking, concrete and metal-clad buildings are hostile to wireless. A picker who has to walk to the office door for a signal is a picker who writes on paper instead.
Plant rooms, lift shafts, basements and remote sites. Job sheets, photos and signatures are captured where there is no coverage and uploaded hours later.
Proof of delivery at a door with one bar. The signature and the photograph must be captured locally and reconciled afterwards, or the delivery is disputed.
Relational data with filtering, sorting and joins belongs in SQLite behind a typed layer. Simple documents belong in a lighter embedded store. What matters more than the choice is keeping the sync layer ignorant of it, so the storage can change without the sync changing.
Every change the user makes becomes an entry that survives the process being killed. Entries carry their own identity so a retry cannot create a duplicate, and they replay in an order that respects dependencies — the parent record before the child that points at it.
Write them down as a table before writing code: entity, strategy, who wins, and what the user sees if it cannot be decided. Last-write-wins for a note. Server-authoritative for anything with money. Field-level merge where edits are naturally disjoint. Explicit human resolution where a silent merge would be a data error.
Nobody needs the whole database on a phone. Sync what this user needs for the territory, the route or the shift, with a window that rolls forward. This is usually the difference between a first sync measured in seconds and one measured in minutes.
These are the bugs that reach production, because they do not happen on a developer’s desk.
The user worked offline for two days; the access token died on day one. The queue fires, every request returns 401, and a naive implementation discards the work. The queue must pause, refresh and resume rather than fail.
A visit is created and then edited. If the edit syncs first, the server has an update for a record that does not exist. Dependency ordering in the queue, not timestamps, is what fixes this.
The request reached the server, the response did not reach the phone. Without a client-generated identity the retry creates a second record, and somebody reconciles it by hand.
Device clocks drift and users change them. Any conflict strategy that trusts the device timestamp will eventually resolve in favour of the wrong edit. Sequence on the server.
Media is large, slow and the first thing to fail on a weak connection. Queue files separately from data, upload in the background, and never block the record on its attachment.
The worst offline user interface is the one that says nothing, because the user cannot tell the difference between saved and lost. The second worst is the one that shouts, putting a red warning on every screen whenever the signal drops — users in genuinely low-coverage work learn to ignore it within a week. What works is quiet, specific and always available.
Consumer apps face a milder version of the same problem a field app does: the network comes and goes mid-task, and the user must not lose anything. These are screens from two shipped apps where that mattered. Tap any image to enlarge it.
What to check before you sign, who owns the accounts and the code, and what the handover must contain.
Whether one codebase suits an app this demanding, and where it stops being the right answer.
The systems these field apps usually talk to, and why the sync contract matters at both ends.
An offline-first field application in production: calls, samples, RCPA and tour plans.
We will prototype the sync and conflict handling for it, free, before you commit to a build.