Offline Search Against Locally Cached Contacts
Coordinators and peer mentors often operate in environments with unreliable connectivity — home visits, rural areas, or public transport. The offline search capability maintains a synchronized local cache of contacts (excluding encrypted sensitive fields) on the device, served by the offline search repository. When the device is offline, the search screen transparently falls back to local cache queries, returning results with appropriate indicators. Cache synchronization runs in the background when connectivity is restored, ensuring the local copy stays current. The cache excludes fields governed by field-level encryption (such as Blindeforbundet's epikrise data) and respects all data minimization principles.
User Story
Acceptance Criteria
- Given the device has no internet connection, when the coordinator searches for a contact by name, then results are returned from the local cache within 500ms
- Given offline search results are displayed, when the list is rendered, then a persistent banner or indicator communicates that results are from local cache and may not be fully up to date
- Given the device regains internet connectivity, when the cache sync service runs, then the local cache is updated with any server-side changes since the last sync
- Given a contact record contains encrypted sensitive fields, when that record is cached locally, then the encrypted fields are excluded from the local cache
- Given the local cache is empty (first-time use with no prior sync), when the device is offline and a search is performed, then an informative empty state explains that data must be synced first
Business Value
Field-based peer mentoring work frequently occurs in low-connectivity environments. An offline-capable search removes a hard dependency on internet access for core coordination tasks, ensuring that coordinators can look up contact details and history during home visits, in rural chapters, or while traveling between locations. This is particularly critical for Blindeforbundet, which emphasizes home visit workflows, and for NHF and HLF chapters in geographically dispersed areas.
Components
- Contact Search Screen ui
- Contact Search Service service
- Offline Contact Search Repository data
- Contact Cache Sync Repository data
- Search Debounce Utility infrastructure
- Field Encryption Utilities infrastructure