Try this:
  1. Click Admit on a few guests below — they sync immediately.
  2. Click WiFi: ONLINE to flip it OFFLINE.
  3. Keep admitting guests. They queue locally.
  4. Click WiFi to bring it back. Watch the queue drain.
  5. Flip Use offline-sync-engine off and try the same flow — see the difference.

Door Scanner

0 pending

Server Ledger

0 admits

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.