devicePendingBackoffMinutes property

int get devicePendingBackoffMinutes

Backoff interval in minutes between pending payload flush attempts.

When a device sync operation fails (network error, offline), the pending payload is stored locally. This interval controls how long to wait before retrying after a failed attempt.

The backoff is bypassed when the timezone, offset, or FCM token actually changes (except when within the change-debounce window), ensuring important updates are synced promptly while avoiding spam during prolonged offline periods.

Can be set via:

  • Code: AppConfigBase.devicePendingBackoffMinutesDefault = 10
  • Build flag: --dart-define dreamic_device_pending_backoff_minutes=10
  • Firebase Remote Config: dreamic_device_pending_backoff_minutes

Default: 15

Implementation

static int get devicePendingBackoffMinutes {
  const envValue = int.fromEnvironment(
    'dreamic_device_pending_backoff_minutes',
    defaultValue: -1,
  );
  if (envValue != -1) {
    return envValue;
  } else {
    final remoteValue =
        g<RemoteConfigRepoInt>().getInt('dreamic_device_pending_backoff_minutes');
    if (remoteValue > 0) {
      return remoteValue;
    } else {
      return defaultRemoteConfig['dreamic_device_pending_backoff_minutes'] as int;
    }
  }
}