Add checks to skip check job if we have a pending or pre-pending transaction.

This commit is contained in:
Alex Hart
2025-09-23 11:39:16 -03:00
committed by Jeffrey Starke
parent b88097a6ae
commit 93815a0504

View File

@@ -103,6 +103,18 @@ class BackupSubscriptionCheckJob private constructor(parameters: Parameters) : C
return Result.success()
}
if (SignalDatabase.inAppPayments.hasPrePendingRecurringTransaction(InAppPaymentType.RECURRING_BACKUP)) {
Log.i(TAG, "A backup redemption is in the pre-pending state. Clearing mismatch and skipping check job.", true)
SignalStore.backup.subscriptionStateMismatchDetected = false
return Result.success()
}
if (SignalDatabase.inAppPayments.hasPendingBackupRedemption()) {
Log.i(TAG, "A backup redemption is pending. Clearing mismatch and skipping check job.", true)
SignalStore.backup.subscriptionStateMismatchDetected = false
return Result.success()
}
val purchase: BillingPurchaseResult = AppDependencies.billingApi.queryPurchases()
Log.i(TAG, "Retrieved purchase result from Billing api: $purchase", true)