Skip to content
Casheeno
All posts

Offline-first on mobile: what actually breaks

Everyone agrees apps should work on a bad connection. Far fewer have decided what happens when two devices disagree about the truth.

By

Offline-first on mobile: what actually breaks

Offline support is easy to demo and hard to finish. Caching reads is the simple half. The hard half is writes - what happens when a queued action reaches a server that has moved on.

Reads are the easy part

Cache the response, show it immediately, refresh in the background, and be honest in the UI about how old the data is.

Writes need a decision, not a library

  • Who wins if the server and the device disagree?
  • Can the same action be applied twice safely?
  • What does the user see when their change is rejected?
  • Does the queue survive the app being killed?

Make every write idempotent

Give each action a client-generated id and have the server ignore duplicates. Without this, a flaky connection quietly becomes double-charges and duplicate rewards.

Test the middle state

Nobody is fully offline. They are on a train with two bars, which is far worse. Test slow, lossy connections - not airplane mode.