Context
Background
Manual sync trigger on the home screen. Runs the fetch sequence in order
and tracks sync state in MMKV after a successful full sync.
Tasks
Sync trigger UI
MMKV state tracking
MMKV keys set here
| Key |
Value |
Set when |
last_synced_at |
2024-01-04T10:32:00Z |
After full sync |
sync_count_projects |
5 |
After sync |
sync_count_chapters |
12 |
After sync |
sync_count_bibles |
3 |
After sync |
Acceptance criteria
Context
Background
Manual sync trigger on the home screen. Runs the fetch sequence in order
and tracks sync state in MMKV after a successful full sync.
Tasks
Sync trigger UI
1.
GET /users/:userId/projects2.
GET /users/:userId/chapter-assignments3. Derive
project_unitsfrom assignments4.
POST /bibles/:bibleId/bulk-textsfor each bibleIdMMKV state tracking
last_synced_attimestamp in MMKV1. Read old count:
storage.getNumber('sync_count_projects') ?? 02. Query new count:
SELECT COUNT(*) as count FROM projects3. Save new count:
storage.set('sync_count_projects', newCount)MMKV keys set here
last_synced_at2024-01-04T10:32:00Zsync_count_projects5sync_count_chapters12sync_count_bibles3Acceptance criteria
last_synced_atis updated in MMKV after a successful full sync