BackgroundSyncWorker
Component Detail
Description
Integrates with platform background-execution APIs to schedule and run synchronisation jobs even when the app is suspended or in the background. On Android it uses WorkManager constraints to require network connectivity; on iOS it registers a BGProcessingTask with BGTaskScheduler to satisfy OS fairness policies.
background-sync-worker
Sources & reasoning
Lines 300-303 explicitly name the sync queue with retry/backoff and ID mapping as architectural components, which map directly to the BackgroundSyncWorker and SyncQueueService in the blueprint. Lines 50-54 reinforce that parallel operation during rollout requires the app's data to stay consistently synchronised with existing systems - silent background sync is the mechanism that makes this possible. The blueprint assigns MVP, consistent with offline-first being a launch-day architectural commitm
-
docs/source/likeperson.md · line 300-303Offline-first persistence (Drift + SQLCipher encrypted local DB, mutation outbox, sync queue with retry/backoff, ID mapping for offline-created entities, conflict resolver)
-
docs/source/likeperson.md · line 50-54Sterk enighet pÄ tvers: Eksisterende lÞsninger mÄ fungere parallelt til appen er godt etablert. Ingen av organisasjonene tÄler et hard-cut.
Responsibilities
- Register the sync job with WorkManager (Android) and BGTaskScheduler (iOS) at app startup
- Invoke SyncQueueService.drainQueue inside the platform-provided execution window
- Respect OS-imposed time budgets and call expiration handlers to avoid task termination
- Reschedule the next sync window after each run based on queue depth and battery state
- Report job success or failure back to the platform scheduler for adaptive scheduling
Interfaces
register(): void
execute(taskId: String): Future<bool>
cancel(): void
scheduleNext(delaySeconds: int): void
handleExpiration(): void
Related Data Entities (3)
Data entities managed by this component