Continue Using the App Offline After Biometric Authentication
Peer mentors may conduct visits in rural areas, care homes, or other locations with poor connectivity. After successful biometric authentication during an online session, the app should cache sufficient state to allow continued offline use including activity registration and contact viewing (for non-encrypted fields). The biometric check itself can be performed locally via the device's biometric hardware without requiring a server round-trip. Session validity checks that require network should be deferred until connectivity is restored, with the cached session used in the interim.
User Story
Acceptance Criteria
- Given I am authenticated and then lose network connectivity, When I try to register an activity, Then the registration flow works normally and data is queued for sync
- Given I am offline and the app is relaunched, When I authenticate with biometrics, Then the local biometric check succeeds and I can access the app using cached data
- Given I am offline after biometric authentication, When I navigate to a screen requiring live data, Then I see a clear non-alarming offline indicator and can view cached data where available
- Given I come back online after offline usage, When connectivity is restored, Then queued activity registrations sync automatically and I am notified of sync completion
- Given biometric authentication succeeds offline, When the device goes online, Then the session is validated with the Supabase backend and refreshed if needed without interrupting the user
- Given I attempt to access encrypted contact details while offline, When the screen loads, Then I see a message that encrypted content requires connectivity and am offered available cached information
Business Value
Peer mentors serving elderly, disabled, and isolated individuals often work in locations without reliable mobile data. If authentication requires a network round-trip, the app becomes unusable precisely when it is most needed. Offline biometric authentication combined with local session caching ensures the activity registration flow — the app's core value — works regardless of connectivity. This is critical for achieving the low-friction registration goal across all partner organizations.
Components
- Biometric Authentication Service service
- Local Auth Integration infrastructure
- Session Resume Manager service
- Secure Session Storage data
- Supabase Session Manager infrastructure
- Local Storage Adapter infrastructure
- Local Storage Adapter infrastructure
- Offline Contact Search Repository data
- Contact Cache Sync Repository data
- Summary Offline Cache data
- Biometric Authentication Service service