purchases-android icon indicating copy to clipboard operation
purchases-android copied to clipboard

UpdatedCustomerInfoListener not triggered

Open Toubap opened this issue 1 year ago • 6 comments

We have a certain amount of users facing an error during a subscription payment flow.

When the method Purchases.purchase is called we can receive a PurchasesError.PurchasesErrorCode.StoreProblemErrorfrom the onError callback method. Which is normal and expected if there's an actual error on the store's side. What is actually weird is that for some of these users we also receive that StoreProblemError error but in the meantime our integration that links RevenueCat to amplitude sends an event to notify about the premium state. The user has actually subscribed and should have received a success callback.

The UpdatedCustomerInfoListener set is never triggered during that ongoing session to notify the new state then the user is stuck.

  1. Environment
    1. Platform: android
    2. SDK version: 6.9.5

Toubap avatar Jan 10 '24 16:01 Toubap

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

RCGitBot avatar Jan 10 '24 16:01 RCGitBot

Hey @Toubap !

Could you send debug logs that reproduce this? You can enable debug logs by following this guide. After they're enabled you'll see logs like this in the console:

[Purchases] - DEBUG: No cached entitlements, fetching [Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID> 200 [Purchases] - DEBUG: Purchaser info updated, sending to delegate

Please ensure the debug logs include the entire app life-cycle, including the messages printed during initialization of the SDK. The more information you include here, the better we'll be able to help.

Let me know if you have any questions!

michaelAtRC avatar Jan 12 '24 17:01 michaelAtRC

Hello This is not something happening on our side. We do not reproduce it. We see this behavior often with our events tracking tool (amplitude). Actually we encounter the same behavior as described here: https://community.revenuecat.com/sdks-51/android-issue-there-was-a-problem-with-the-store-2187?tid=2187&fid=51

Toubap avatar Jan 15 '24 10:01 Toubap

Hey @Toubap !

Unfortunately, Store problem errors are forwarded from Apple/Google/Amazon and indicate that there was a problem connecting to the App Store, Play Store, or Amazon Appstore. Since these are coming directly from them they aren't immediately happening on our end so we don't have full information on what happened in that instance.

The problems that will trigger this on iOS:

The problems that will trigger this on Android:

To solve this, if everything was working while testing, you shouldn't have to do anything to handle this error in production. RevenueCat will automatically retry any purchase failures so no data is lost.

I hope that helps!

michaelAtRC avatar Jan 24 '24 19:01 michaelAtRC

Unfortunately the retry mechanism isnt working as you can see in this thread and on our side. Maybe another call to Purchase.configure or Purchase.syncPurchase could help getting up to date user info? It is very annoying not to have real guidelines about that as it happens a lot and as we miss a lot of potential revenues. Users are also facing unexpected behavior that we now have to handle

Toubap avatar Jan 29 '24 08:01 Toubap

Hey @Toubap !

We only recommend configuring once as configuring more than once will likely cause more issues. You can call syncPurchases in this case as that should be safe!

michaelAtRC avatar Feb 01 '24 22:02 michaelAtRC