Skip to content

feat(mobile): offline cache with Drift + stale-data banner#44

Merged
gracefullight merged 2 commits intomainfrom
symphony/FIR-34
Mar 21, 2026
Merged

feat(mobile): offline cache with Drift + stale-data banner#44
gracefullight merged 2 commits intomainfrom
symphony/FIR-34

Conversation

@gracefullight
Copy link
Member

Summary

  • Add Drift (SQLite) database with CachedContacts, CachedRelationships, and SyncMetadata tables for offline-first data caching
  • Add connectivity_plus-based online/offline detection with Riverpod providers
  • Add contacts repository with API sync + local cache pattern, and stale-data banner widget showing offline status with last sync time
  • Update contacts screen to display cached contact list with offline-aware empty states

Test plan

  • flutter analyze — no issues
  • flutter test — all tests pass
  • dart run build_runner build — Drift codegen succeeds without warnings
  • Manual: toggle airplane mode → verify stale-data banner appears
  • Manual: verify contacts list renders from cache when offline
  • Manual: verify sync triggers when connectivity restored

🤖 Generated with Claude Code

gracefullight and others added 2 commits March 21, 2026 21:43
Add offline-first caching infrastructure for contacts using Drift (SQLite)
and connectivity detection via connectivity_plus.

- Drift schema: CachedContacts, CachedRelationships, SyncMetadata tables
- Database provider: Riverpod singleton with lazy SQLite connection
- Connectivity provider: stream-based online/offline detection
- Contacts repository: API sync + local cache pattern with Dio
- Contacts provider: auto-sync when online, serve from cache when offline
- StaleDataBanner widget: shows offline status with last sync time
- Contacts screen: list view with offline banner and empty states

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts:
#	apps/mobile/lib/features/contacts/contacts_provider.dart
#	apps/mobile/lib/features/contacts/contacts_screen.dart
@gracefullight gracefullight merged commit 35403d2 into main Mar 21, 2026
2 checks passed
@gracefullight gracefullight deleted the symphony/FIR-34 branch March 21, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant