fix(billing): Prevent crash when billing service disconnects

This commit is contained in:
darken
2026-03-12 11:59:07 +00:00
committed by Matthias Urhahn
parent 193a1030fb
commit 2db01b410b
2 changed files with 5 additions and 3 deletions
View File
@@ -24,9 +24,11 @@ class BillingDataRepo @Inject constructor(
) {
private val connectionProvider = billingClientConnectionProvider.connection
.catch {
log(TAG, ERROR) { "Unable to provide client connection:\n${it.asLog()}" }
throw it
.retryWhen { cause, attempt ->
if (cause is CancellationException) return@retryWhen false
log(TAG, ERROR) { "Unable to provide client connection (attempt=$attempt):\n${cause.asLog()}" }
delay(60_000) // 60s between retries (upstream already did 5 quick retries)
true
}
.replayingShare(scope)