A door scanner that keeps working when the venue's WiFi dies.
Pull the plug. Scan a few people. Plug it back in. Every admit lands
in the server exactly once.
Try this:
Click Admit on a few guests below — they sync immediately.
Click WiFi: ONLINE to flip it OFFLINE.
Keep admitting guests. They queue locally.
Click WiFi to bring it back. Watch the queue drain.
Flip Use offline-sync-engine off and try the same flow — see the difference.
Door Scanner
0 pending
Server Ledger
0 admits
⚠ 0 duplicate admits recorded
What's happening?
Library OFF
Tap Admit while offline → the request fails and the admit is silently lost (or piles up in a naive retry array).
On reconnect, naive retries can re-send admits the server already received but couldn't ack — producing duplicates.
No idempotency key means the server can't tell a retry apart from a fresh admit.
Library ON
Tap Admit → mutation gets a client-generated ULID and is persisted in IndexedDB. The UI updates optimistically. Returns instantly.
Offline? Queue drains automatically when the network returns. Browser refresh? Queue survives.
Same key sent twice (because an ack got lost) → server returns the cached commit. Exactly-once.
Everything in this demo — scanner, queue, server, network — runs in
your browser. The WiFi button just gates whether outgoing requests
succeed. There's no actual backend, but the queue/server primitives
you're seeing are the real library code from
offline-sync-engine.