startUpSyncWork

Creates a WorkRequest for initial sync on app startup.

This method creates a one-time expedited work request with:

  • Expedited: Runs as soon as possible, promoted to foreground service

  • Unique: Only one sync runs at a time (enforced by enqueueUniqueWork)

  • Network Constraint: Only runs when network is available

  • Delegated: Uses DelegatingWorker to enable Hilt injection

Expedited Work

Expedited work is prioritized by WorkManager and runs in the foreground. If the system quota for expedited work is exhausted, it falls back to normal work (via OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST).

Delegation Pattern

Uses DelegatingWorker to enable Hilt dependency injection in Workers. The actual worker class (SyncWorker) is passed via delegatedData().

Return

A OneTimeWorkRequest configured for startup sync

See also

Sync.initialize