A phone is a copy of your data that goes offline without warning and comes back disagreeing. Most mobile bugs are exactly that.
Picture a salesperson using a property app in a basement showroom with no signal. They update three deals, add a note, and put the phone away. Ninety minutes later the app reconnects. Its changes must now be matched with a server that has accepted changes from two colleagues and an overnight import.
That's not really a mobile problem. It's the problem of keeping several copies of the same data in agreement when they can't always talk. Think of a group project where everyone edits their own copy of a file. That is a distributed system: many machines that have to act like one. The only unusual part is that one copy lives in a pocket.
Phone networks are not always fast or reliable. Worse, they often fail without any warning.
Wi-Fi can show full bars while nothing loads. Public Wi-Fi can answer every request with a login page, so code expecting data gets HTML (a web page) instead. Each of these turns into the report "sometimes it doesn't save," which nobody can repeat on office Wi-Fi. The system isn't broken. It works as designed, in a place its design didn't expect.
A cache keeps the last answer so the screen has something to show when the network is down, but saving still assumes the server is reachable. Offline-first means the phone's copy is the truth for the screen, and talking to the server is a background chore that catches up later.
Two people edited the same deal, and one was offline. Engineers often list the options: last one wins, merge, keep both, server decides. Starting from that list is the mistake. Start from what a person expects, field by field.
| Field | What to do | Why |
|---|---|---|
| Stage | Most recent deliberate change wins | A stale update must not undo progress |
| Notes | Keep both, append | Last one wins would destroy a note |
| Owner | Stop and ask a person | No algorithm can settle who owns it |
The OS, the network layer and your own queue all retry, so the server getting the same change more than once is just routine. It's like sending a message, seeing no confirmation, and sending it again. If creating a deal isn't safe to repeat, that basement showroom produces three deals.
The device-made ID from earlier does double duty here, which is a nice bonus of good design.
Once the phone is just another copy of the data, bug reports stop being a random pile.
| Report | Real problem |
|---|---|
| Sometimes it doesn't save | Durable queue |
| It saved and then went back | Disagreement |
| It made two | Repeat delivery |
| It showed me old data | Cache |
The network isn't going to get better. Your model of what you're building can.