Onboarding Steps in an Offline-First App
An offline-first client can mark a step complete before the server has seen it. That gap between local and confirmed state is where onboarding progress quietly lies.
An offline-first app writes to its local store first and syncs later. That's the whole point — a user on a flaky connection or a plane should be able to tick a step and keep working. But an onboarding checklist that shows a step as done the instant the client says so is making a promise the server hasn't confirmed yet. Most of the time the sync succeeds quietly and nobody notices the gap existed. The gap matters on the two paths where it doesn't: the sync fails, or two devices disagree about what happened first.
Local-done and server-done are two different states
The checklist UI usually has one boolean per step: done or not. An offline-first client needs a third state in between — completed locally, not yet acknowledged by the server — and it needs to render it differently, even if only with a small sync indicator. Collapsing the three states into two is the actual bug. A step that silently reverts from checked to unchecked after a failed sync reads to the user as the app forgetting what they did, not as a network problem the app is honestly surfacing.
type StepState int
const (
StepPending StepState = iota
StepLocalOnly // written to local store, not yet synced
StepSynced // server has acknowledged the write
)
Keeping StepLocalOnly as a first-class state — not a transient flicker you hope resolves before anyone looks — is what makes the eventual failure case renderable instead of surprising.
What the server does when it finally sees the write
When connectivity comes back, the client replays queued completions. The server's job at that point is narrow: accept a completion that is already true (the step wasn't done, now it is — same as the online path), and quietly no-op a completion that arrived twice, because a client that queues writes will sometimes also retry them. An onboarding complete_step endpoint that isn't idempotent on (account_id, step_id) will double-fire anything downstream of completion — a webhook, an email, a credit grant — the first time a sync retries after a timeout rather than a real failure.
The retry case overlaps with retrying a failed step safely in general; offline-first just means the retry can be delayed by hours instead of seconds, and can arrive bundled with several other queued writes from the same session.
When two devices queue conflicting writes
A user completes a step on their phone while offline, then opens the same account on a laptop that's online and the server already has a different, older view of that step. Onboarding steps are usually monotonic — once done, staying done is the only sane resolution — so the safe default is: a synced completion never gets un-done by an older queued write arriving late. Keep a timestamp on the local write (set when the action happened, not when it synced) only to order events in a log; don't use it to decide whether the step is done, because a device with a wrong clock can otherwise un-complete a step that's already confirmed.
If the app also supports continuing onboarding on a different device, this conflict case is the same mechanism under load: two clients, one source of truth, and the rule that server-acknowledged state always wins over a locally queued one.
What a failed sync should look like to the user
If the queued write never makes it — the account was deleted, a validation rule changed server-side, the step no longer exists — the step has to visibly revert, with a reason, rather than sit in a permanent spinner or silently flip back unexplained. "This step couldn't be confirmed, try again" is a worse experience than an online-only checklist would ever produce, but it's an honest one, and it's recoverable. A step that looks done on a plane and looks undone on the ground with no explanation teaches the user not to trust the checklist the next time they're offline.
What to measure instead of guessing
No number here is safe to invent — not how often syncs fail, not how long the average queued write waits. What's worth instrumenting is the gap itself: log the time between a step entering StepLocalOnly and reaching StepSynced, and separately count how many queued completions the server ever rejects outright. A rejection rate near zero means the offline path is mostly cosmetic reassurance; a rate that isn't near zero means users are seeing checklist state that doesn't match what the server will eventually agree to, and that's worth fixing before it shows up as a support ticket about a step that "keeps undoing itself."
See the docs for how step completion requests are structured if you're adding offline queuing to an existing integration.