SyncQueueService
Component Detail
Description
Manages the mutation outbox by enqueuing, prioritising, and draining pending write operations that were created while offline. It processes mutations in FIFO order, applies exponential backoff on transient failures, and notifies Riverpod notifiers once a batch is successfully committed to the server.
sync-queue-service
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
- Enqueue mutation records into the outbox with a timestamp and retry counter
- Drain the outbox in order when network connectivity is detected
- Apply exponential backoff and cap retry attempts for failed mutations
- Emit batch-complete events so Riverpod notifiers can refresh local state
- Deduplicate or collapse redundant mutations before transmission
Interfaces
enqueue(mutation: MutationRecord): void
drainQueue(): Future<SyncResult>
retryFailed(): Future<void>
clearQueue(): void
getQueueDepth(): int
Related Data Entities (7)
Data entities managed by this component