We have integrated RevenueCat Android SDK with our native Android app. Almost all of the purchases are handled as expected but sometimes it doesn’t. I observed very few customers have been facing the below PurchaseError.
PurchasesError(code=PurchaseInvalidError, underlyingErrorMessage=Couldn’t find existing purchase for SKU: {subscription_id}, message=‘One or more of the arguments provided are invalid.’)
I read the source code of the purchases-android SDK, and if my understanding is correct, this error occurs when it fetches purchase history via BillingClient and there’s no record that matches with the subscription ID set by `PurchaseParams::oldProductId({subscription_id})`.
I believe it is NOT something like network issue or service unavailable error, etc, since if there’s an issue between client and Google billing system, it should NOT go through the code that emits the PurchaseError in question. (should go onError route instead)
FYI: https://github.com/RevenueCat/purchases-android/blob/40edf5b1269b1199b01606ac0014f434e2191a73/purchases/src/main/kotlin/com/revenuecat/purchases/google/BillingWrapper.kt#L497-L499
So the question is, why/how could it happen? And is there anything we developer can do for it?