Data Layer high complexity mobile
1
Dependencies
6
Dependents
4
Entities
0
Integrations

Description

Persistent table and access layer that records every pending write with its operation type, entity type, payload, retry count, and status. Acts as the durable queue between offline mutations and the background sync process, ensuring no write is lost across app restarts or crashes.

Feature: Offline Data Support

mutation-outbox

Responsibilities

  • Record every offline write with operation type, entity type, serialized payload, and retry count
  • Expose ordered pending mutations for the sync queue to consume
  • Update mutation status on sync success, failure, or rollback
  • Increment retry counter and surface mutations exceeding retry threshold
  • Support atomic status transitions within Drift transactions

Interfaces

enqueue(mutation: PendingMutation): Future<int>
getPending(): Future<List<PendingMutation>>
markSuccess(mutationId): Future<void>
markFailed(mutationId, error): Future<void>
incrementRetry(mutationId): Future<void>
remove(mutationId): Future<void>
getFailedExceeding(maxRetries): Future<List<PendingMutation>>