Offline-First League Management: Surviving Venue Dead Zones
Pool halls are notorious for poor cellular reception—often situated in commercial basements, steel-beam warehouses, or thick concrete facilities. An app that depends on constant cloud connectivity will fail on league night.
Architectural Principles
Section titled “Architectural Principles”- Local-First Writes: Every score button tap updates local state and writes to persistent device storage before any network request is attempted.
- Pending Write Metadata: The Flutter app inspects
snapshot.metadata.hasPendingWritesto show immediate visual feedback that a shot was recorded locally. - Automatic Cloud Sync: When network connectivity is re-established (monitored via
InternetConnectionChecker), queued mutations are streamed to Google Cloud Firestore in order. - Offline Signatures: If Wi-Fi is entirely down at midnight when the match concludes, captains sign the local device. The cryptographic hash and signatures are cached and automatically uploaded once either captain reaches cellular range outside the venue.
