Infrastructure high complexity mobile
1
Dependencies
1
Dependents
0
Entities
0
Integrations

Description

Hosts and schedules background sync execution using Flutter background isolates combined with WorkManager (Android) and BackgroundFetch (iOS). Responds to connectivity-change events via ConnectivityPlus to trigger immediate sync on reconnect, and registers periodic intervals to catch missed windows.

Feature: Background Sync

background-sync-scheduler

Sources & reasoning

A dedicated background execution host is required to invoke the sync cycle without user interaction. The feature implementation notes specify a Flutter background isolate or WorkManager task polling on connectivity events and scheduled intervals - this infrastructure component separates that scheduling and platform-lifecycle concern from the SyncQueueService business logic, keeping each unit testable and replaceable.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Register WorkManager periodic tasks and BackgroundFetch handlers for scheduled sync intervals
  • Listen to ConnectivityPlus connectivity-change events and trigger immediate sync on reconnect
  • Spawn background isolates to execute the SyncQueueService cycle off the main UI thread
  • Handle platform-specific background execution constraints and lifecycle hooks on iOS and Android
  • Coordinate scheduler teardown and re-registration across app lifecycle events

Interfaces

initialize(): Future<void>
schedulePeriodicSync(interval: Duration): void
triggerImmediateSync(): void
cancelAll(): void
onSchedulerEvent: Stream<SchedulerEvent>

Relationships

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component