Offline-First Apps: The Sync Problem Nobody Shows in Demos
What happens when two devices edit the same record offline? A worked guide to the hidden tradeoffs, practical checks, and implementation decisions.
What happens when two devices edit the same record offline? A worked guide to the hidden tradeoffs, practical checks, and implementation decisions.
Preserve enough information to explain a conflict: the base version, the competing changes, and the relevant authors or devices when appropriate. A user should not face two unexplained copies called “final” and “final latest.” Good synchronization design includes the recovery experience, not just the happy path in which no edits collide.
How would I design a conflict users can actually resolve?
Start with a concrete scenario: two devices edit the same project task from version 12 while offline. One changes the due date; the other changes both the title and due date. On reconnection, merge the independent title edit and surface the competing date values with their context instead of discarding either silently.
Show a compact comparison in the product's own language: current date, incoming date, and the task context needed to choose. Offer a clear way to keep one value or enter a third. Preserve the unchosen version in an appropriate history so a mistaken resolution can be corrected without reconstructing the entire task.
Test deletion separately. A device may edit a record that another device deleted while offline, and automatically restoring it can surprise users just as much as discarding the edit. Decide whether to preserve a recoverable copy, require confirmation, or reject the update with an explanation appropriate to the application's data.
Write acceptance cases for duplicate delivery, out-of-order delivery, reconnecting twice, and an interrupted resolution. The system should not create repeated records or lose the user's selected outcome. A reliable design makes these states understandable and recoverable even when the network behaves badly, rather than promising that conflicts will never occur.
Comments 0
Share how you would use this prompt or suggest a useful improvement.