delayBeforeSyncRetry
internal suspend fun NetworkStateObserver.delayBeforeSyncRetry(retryDelay: Duration, exponentialDurationHelper: ExponentialDurationHelper, logger: KaliumLogger, syncType: SyncType, timeSource: TimeSource = TimeSource.Monotonic, onRetryStateChanged: suspend (SyncRetryStatus) -> Unit = {}, retryController: SyncRetryController = SyncRetryController(), failureGeneration: Long? = null, previousNetworkId: String? = observeCurrentNetwork().value?.id)
Waits for retryDelay before the next sync retry attempt, completing earlier if internet connectivity comes back in the meantime, or if a validated network other than previousNetworkId becomes available.
On reconnection, exponentialDurationHelper is reset: if the retry fails right away (e.g. DNS is still catching up), the next failure backs off from the minimum delay instead of inheriting the stale pre-reconnect backoff.
Parameters
previousNetworkId
the network the failed attempt started on.