Clubvolare
← All reference
feature

Offline Behaviour

What it does

App-shell PWA with IndexedDB caching of trip data, documents, reminders, checklists, reference articles. Reads work fully offline; writes queue and flush on reconnect.

How it works

  • App shell: useServiceWorker caches HTML/JS/CSS
  • Data cache: src/lib/offline-db.ts v5 — IndexedDB stores per table
  • Pre-warming: src/lib/trip-prewarm.ts runs on trip view → caches itinerary, documents (blobs!), reminders, checklists
  • Write queue: src/lib/sync-queue.ts — offlineWrite() wraps mutations and queues if offline

What works offline

  • ✓ Read: trips, itinerary, documents (incl. file blobs), reminders, checklists, readiness, reference, safety hub
  • ⚠ Write: only where offlineWrite() is wired (full coverage is Batch 2)
  • ✗ AI: requires network — show toast, save draft input
  • ✗ Discover/Connectivity: cached after first view

Indicators

  • useOnlineStatus — header banner when offline
  • usePendingSync — pending count surfaced as badge (UI surface coming in Batch 2)

Related files

src/lib/offline-db.ts, src/lib/sync-queue.ts, src/lib/trip-prewarm.ts, src/hooks/useServiceWorker.ts, src/hooks/useOnlineStatus.ts, src/hooks/usePendingSync.ts

Tags: offline, pwa, sync, cache
Updated 5/26/2026