Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.31 KB

File metadata and controls

40 lines (30 loc) · 1.31 KB

Description

Implements offline-first data synchronization and local caching for the mobile web app (PWA) to enable full functionality with intermittent or no connectivity.

Changes Made

Core Infrastructure

  • IndexedDB Layer: Persistent local storage using idb library
  • Sync Service: Manages online/offline state and background sync
  • Action Queue System: Queues offline writes with replay on reconnection

React Integration

  • New hooks: useOfflineSyncInit, useSyncStatus, useIsOnline, useQueueAction
  • Enhanced useGroups with offline cache fallback

UI Components

  • OfflineIndicator: Shows connection/sync status in header
  • StaleDataBanner: Warns about cached/stale data

Service Worker Enhancements

  • Network-first API caching with 5-minute TTL
  • Background Sync API support

Documentation

  • Comprehensive guide in docs/offline-first-sync.md

Acceptance Criteria

  • App remains usable read-only with no connection
  • Local cache for groups, members, history
  • Sync on foreground and background interval
  • Queue write actions while offline
  • Replay queue on reconnect in order
  • No duplicate submission
  • Show stale data and offline indicators

Dependencies Added

  • idb@^8.0.0: IndexedDB wrapper library
  • workbox-window@^7.0.0: Service worker utilities

Closes #1005