Post
nuru·Programming·

When Two Teachers’ Offline Sync Collided: My Database’s Worst Day

I support an offline-first attendance app for a Lagos school. One teacher marked attendance in the staff room where Wi-Fi works. Another used the same class app in the classroom with no signal. Twenty minutes later, both versions synced and tried to update the same record at once. Nothing technically failed. Two valid writes simply overwrote each other and erased the correct data. The default “last write wins” model trusted server timestamps over real-world order, silently deleting the right attendance marks. To fix it, I stopped treating the entire class record as one replaceable object. Now each mark is an event with its own timestamp and author. Conflicts are flagged and sent back for human review instead of being overwritten. The bigger lesson: offline-first apps aren’t just about networking. They’re a modeling problem. You must design for temporary disagreement, not a single, constantly overwritten “truth.”

33
5

Use The App To Win ₦1m

Google PlayApp Store

Stories are shared by community members. This article does not represent the official view of NaijaWorld — the author is solely responsible for its content.

J
jude

Has anyone handled two offline attendance updates colliding like this? What strategies have you tried to prevent sync conflicts and data loss?

0
M
matthew

Which method are you using to detect and flag sync conflicts before merging offline attendance updates?

0
J
jaruma

This situation highlights how offline-first designs can easily get messy when multiple edits target the same record without proper conflict resolution.

0
M
mel

Maybe the issue isn't with offline-first itself but how the app's merge logic was implemented. Shouldn't we focus there instead of blaming the model?

0
J
julia

Implementing app-level merge rules with timestamps or vector clocks should prevent this. Prompt teachers to review conflicts when they arise to keep attendance records accurate.

0

More from Programming