The short answer

Design offline field work around explicit rules for reconciling edits. Preserve local work, check the version a change was based on, and make unresolved conflicts visible to the person who can decide. A successful upload should not silently erase another valid correction.

At a glance

  • Agree which fields can be edited offline and how competing changes will be resolved.
  • Use enforced version checks where supported, and preserve unsent work when a change is rejected.
  • Show server acceptance and unresolved conflicts separately from network connectivity.

The note arrived. The correction disappeared.

At four in the afternoon, a maintenance technician's tablet finds a connection again. The morning's work order finally uploads, complete with a new visit note. Back at the office, the appointment time has reverted to the old value. Somebody corrected it while the technician was offline; the tablet has just sent an entire older form back. This is an imagined public-service maintenance visit, not a reported delivery or incident. Both people did useful work. The product failed to preserve it. Before celebrating an app that works without a signal, ask what happens when its version of a record meets somebody else's.

Decide what people can change offline

Android's offline-first architecture guidance treats reading and writing as separate design questions. It explains that local writes can conflict with network data when connectivity returns, and that an offline-first app does not have to support offline writes at all. Our recommendation is to decide what staff actually need to change away from a connection. Perhaps they must capture a visit note and photograph, while a change to the official appointment needs a different route. Agree those boundaries with the service owner. A broad promise that every screen works offline leaves the most consequential decisions until two versions collide.[1]

Last write wins needs a product decision

Take Cloud Firestore as one concrete implementation. Its offline documentation says that multiple changes to the same document use last write wins. That describes a conflict rule; it does not establish which person's decision is right for the service. Before adopting a rule, ask whether a visit note should be added as a separate event, whether unrelated fields can be combined safely, and which appointment changes need review. We would make a whole-record overwrite a deliberate product choice with an understood consequence. A timestamp or a successful upload cannot explain why the appointment was changed or whether that correction should be kept.[2]

Make the stale version visible

A small API rule can help expose the collision. RFC 9110 describes If-Match as a way to prevent accidental overwrites when several clients change the same resource. An app can send the entity tag associated with the version it read; where the server supports and enforces that condition, it can refuse an outdated edit with a 412 response instead of applying it. For our maintenance example, we would preserve the technician's unsent note and fetch the current record for comparison. The server must evaluate the condition before performing the write. Detecting a conflict still leaves the service's rules to decide what happens next.[3]

Give the operator a way to finish

Give the operator enough information to finish that decision. We would distinguish saved on this device, waiting to send, accepted by the server and needs review. Show the fields that differ and retain the local work while the responsible person chooses an allowed resolution. If a defined rule permits merging independent fields, explain what was kept. If a consequential value needs review, name the next person and make the handoff visible. A green connection indicator tells the technician that the network is available. The product should separately tell them whether the visit record is accepted or still waiting for attention.

Rehearse the reconnect

Rehearse this with the people who will operate the service. Start two devices from the same record, disconnect one, and make a legitimate correction from the other. Bring the first device back after adding its field note. Repeat with the reconnection order reversed and with an app restart before sending. Check the final record, the retained local work and the history of how the conflict was resolved. Ask an ordinary service colleague to complete the review using only the information on screen. Returning connectivity should bring the day's work together. It should not quietly undo somebody else's valid correction.

“The finest government technology is the technology citizens barely notice. They shouldn't have to understand ten departments to complete one task. Our job is to connect the complexity behind the scenes and make life simpler on the other side.”

Sources and further reading

  1. Android Developers — Offline-first apps: write strategies, synchronisation and conflict resolution ↗
  2. Firebase — Cloud Firestore offline data: synchronising multiple changes to one document ↗
  3. IETF RFC 9110 — Section 13.1.1: If-Match and prevention of lost updates ↗

See how to plan a project in Namibia and Tanzania.

Explore Software & Digital Product Engineering