Menu

1 / 2

Offline-First Sync Failures That Flight Mode Won't Show You

DEV Community: firebase·Ayesha Iftikhar·about 15 hours ago
#y5KZIZJh
#devtofirebase#devto#dev#sync#entry
Reading 0:00
15s threshold

* Clock skew, deletes that come back, duplicate entries on a flaky connection, and old databases: the tests I added after auditing my own Flutter app.

*

Short answer: Testing offline-first sync by switching on flight mode only tests the polite case: the network is either there or it isn't. The bugs that lose people's data come from messier conditions: a device with the wrong clock, a delete on one phone while another phone edits the same entry, a connection that drops just after a write was sent, two syncs running at once, and a database created by an older version of the app. This post walks through each one in a real Flutter app, what goes wrong under last-write-wins, and the fix.

I build Mindleau , a brain dump journal and mood tracker. It's local-first: every entry is written to SQLite (via Drift) on the phone, and a sync layer pushes it to Firestore in the background. I've written about the local-first architecture and about anonymous auth, tombstones and timeouts .

Those posts describe the design.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.