Fully check result code when processing purchase results.

This commit is contained in:
Alex Hart
2025-10-01 09:50:42 -03:00
committed by Michelle Tang
parent 76448f5426
commit 87535a917a
3 changed files with 98 additions and 93 deletions

View File

@@ -252,7 +252,10 @@ class BackupStateObserver(
if (SignalStore.backup.subscriptionStateMismatchDetected) {
Log.d(TAG, "[getNetworkBackupState][subscriptionStateMismatchDetected] A mismatch was detected.")
val hasActiveGooglePlayBillingSubscription = when (val purchaseResult = AppDependencies.billingApi.queryPurchases()) {
val purchaseResult = AppDependencies.billingApi.queryPurchases()
Log.d(TAG, "[getNetworkBackupState][subscriptionStateMismatchDetected] queryPurchase result: $purchaseResult")
val hasActiveGooglePlayBillingSubscription = when (purchaseResult) {
is BillingPurchaseResult.Success -> {
Log.d(TAG, "[getNetworkBackupState][subscriptionStateMismatchDetected] Found a purchase: $purchaseResult")
purchaseResult.isAcknowledged && purchaseResult.isAutoRenewing