Open the console

Keeping an Onboarding Checklist Correct on a Flaky Connection

What happens to a checklist step completion when the network drops mid-request, and how to queue it so the user doesn't redo work or lose progress.

Keeping an Onboarding Checklist Correct on a Flaky Connection

A checklist step completes the moment a user clicks the button, confirms the action, and the browser fires a request to mark it done. That sequence assumes a network that's there when you need it. On a train, in a basement office, on a hotel wifi that drops every few minutes, the request can fail halfway, time out, or succeed on the server while the response never makes it back. None of those are edge cases if enough of your users are mobile or working from unreliable connections — they're a normal Tuesday for a meaningful share of accounts, and the checklist has to behave correctly through all three.

The failure that actually damages trust in the product isn't a step failing to complete. It's a step that completes twice, or a step the user is certain they finished that still shows unchecked the next time they open the app. Both are solvable, and both are solvable without heavyweight offline-sync infrastructure — a checklist's state is small and the conflict surface is narrow.

Three ways a connection drop shows up

Separate the failure modes before picking a fix, because they need different handling:

  • Request never sent. The user clicks complete while fully offline. The browser knows this immediately — navigator.onLine is false, or the fetch throws before it leaves the machine.
  • Request sent, response lost. The step completion reached your server and was recorded, but the connection dropped before the 200 came back. The client has no way to tell this apart from case three just by looking at its own state.
  • Request sent, never arrived. The connection dropped mid-flight and the server never saw it. From the client's side, this looks identical to case two: a hung or failed request.

The client can't distinguish case two from case three on its own. That's fine — the fix for both is the same, and it doesn't require the client to guess.

Make completion idempotent before worrying about queuing

The retry strategy only works if calling complete twice for the same step is harmless. That means the completion endpoint needs a stable idempotency key — the step ID plus the account ID is usually enough — and the handler needs to check current state before writing, not just append a new completion row.

func CompleteStep(accountID, stepID string) error {
    existing, err := store.GetCompletion(accountID, stepID)
    if err == nil && existing != nil {
        return nil // already done, retrying this call changes nothing
    }
    return store.InsertCompletion(accountID, stepID, time.Now())
}

With that in place, a client retrying a completion request three times because the network is bad does exactly as much damage as retrying it once. This is the same principle that makes webhook delivery retries safe downstream — the receiving side de-dupes, so the sending side is free to be aggressive about retrying.

Queue the action locally, don't block the UI on the network

Once completion is idempotent, the client can afford to be optimistic. Mark the step complete in local state the instant the user acts, write the pending action to a small local queue (localStorage or IndexedDB is plenty — this is a handful of step IDs, not a sync engine), and let a background retry loop drain that queue whenever the connection is up.

function queueCompletion(stepId) {
  const pending = JSON.parse(localStorage.getItem('pendingSteps') || '[]');
  pending.push({ stepId, queuedAt: Date.now() });
  localStorage.setItem('pendingSteps', JSON.stringify(pending));
  flushQueue(); // no-op if offline; retries on the next online event
}

window.addEventListener('online', flushQueue);

The user sees the step checked off immediately, which is correct from their perspective — they did the thing. The queue is just making sure the server eventually agrees, without making the user wait on a spinner for a network that might not come back for ten minutes.

What to show when a completion can't be confirmed

Optimistic UI has one honesty obligation: if a queued completion fails permanently (not a timeout, but a real error — the step no longer exists, the account was downgraded, whatever), the checklist needs to un-check that step and say why, rather than leaving a confidently wrong checkmark on screen indefinitely. A step stuck in "pending, retrying" for more than a few minutes is worth a small, unobtrusive indicator rather than silence, especially since this is exactly the situation that produces a support ticket if the user has no idea their action didn't actually land.

Decide how long a queued action is worth keeping

A queue entry from a session three days ago, on a device the user hasn't opened since, is more likely to be stale than correct — the step might have been completed another way, or removed from the checklist in an editorial change, by the time the queue finally gets to flush it. Expiring queue entries after a short window (a day is a reasonable default) and letting the server be the source of truth on reconnect avoids resurrecting a completion nobody asked for anymore.

What this doesn't need

It's tempting to reach for a full offline-first sync library the moment "handle flaky connections" comes up, but a checklist's state doesn't need conflict-free replicated data types or a merge algorithm — it needs idempotent writes and a small retry queue. Save the heavier tooling for parts of the product where two offline users can both edit the same mutable record; a checklist step only ever moves one direction, from incomplete to complete, which is the easy case.

What to measure

How often completions are actually delayed by connection drops in the wild isn't something to estimate from here — it depends on your users' networks, not the widget. Once the retry queue exists, instrument the gap between queuedAt and the timestamp the server actually records the completion, and track how many queued completions expire unflushed. That gap, split by device type, is the real signal for whether this is worth more engineering time or already a non-issue for your audience. See piping checklist events into your analytics for where that timestamp belongs once you have it.

Check the docs for the current completion endpoint contract before wiring up a local retry queue.

Try it on your app