Skip to main content
Question

Users losing access to entitlements after switching from active to activeInCurrentEnvironment

  • 13 September 2022
  • 7 replies
  • 363 views

Forum|alt.badge.img+5

Hey,

Recently I switched my unlock check from look for entitlements in `active`, to looking in `activeInCurrentEnvironment`, in order to prevent people unlocking Pro in TestFlight and carrying it over to production.

This went smoothly for them majority of users, but a couple of users  have reported losing access to their Pro status, despite having active subscriptions/production lifetime purchases. 

I got one user to send through a recording of his error, and the purchase flow went as follows:

  1. Launches app, I call `getCustomerInfo` with a policy of `notStaleCachedOrFetched`, I then pass that to a function call `handlePurchaseInfo`, which determines the user does not have any active entitlements.
  2. They open the Pestle Pro screen, which determines they are ineligible for a trial.
  3. They hit ‘Restore Purchases’, which triggers the RevenueCat restore purchases flow, and I pass the result to the same `handlePurchaseInfo` method from before. In this case, `activeInCurrentEnvironment` is empty, so I throw a `noPurchasesRestored` error, indicating to the user that no purchases were found to restore. 
  4. Then they attempt to subscribe to the plan they know they are on, but get an App Store error, stating “You are currently subscribed to this”, with a renewal date in the future. 
  5. After tapping ‘Ok’ to dismiss the popup, they get a ‘RevenueCat.ErrorCode 2’ error popup, indicating (I believe) a `storeProblemError`.

 

When I look up their data on RevenueCat, it indicates that they have an active subscription/lifetime in the production environment.

Images of functions:

This is called on attempting to purchase a package from `currentOffering`.

This is restore purchases:

 

And this is `handlePurchaseInfo`

The affected customers are understanding and would likely be willing to work with me on fixing the issue, but would appreciate some guidance. 

7 replies

joshdholtz
RevenueCat Staff
Forum|alt.badge.img+5
  • RevenueCat Staff
  • 92 replies
  • September 13, 2022

I think I found the issue! Seems to be this user purchased in box sandbox and live but the entitlement is getting returned with `is_sandbox` flag which is why this is getting filtered out.

 

Working on a fix!


Forum|alt.badge.img+5
  • Author
  • Member
  • 5 replies
  • November 7, 2023

Any update on this one?


Forum|alt.badge.img+5
  • Author
  • Member
  • 5 replies
  • February 21, 2024

Any updates josh? It’s been over 500 days since I opened this ticket and I would love to close this loophole of sorts.


joshdholtz
RevenueCat Staff
Forum|alt.badge.img+5
  • RevenueCat Staff
  • 92 replies
  • February 21, 2024

@will Hey, sorry! We have a internal proposal with multiple solutions for this made. We’ll hopefully have an answer for you soon on the approach we are going to take for this!


Forum|alt.badge.img+5
  • Author
  • Member
  • 5 replies
  • April 5, 2024

Hey Josh, any updates here? I’m getting more people finding TestFlight links and buying the Lifetime unlock and I’ve got no real way of preventing their production access right now.


Forum|alt.badge.img+1

@joshdholtz any update on this? it’s been a long standing issues and affects testing and prod if they cannot be clearly separated.


Forum|alt.badge.img+5
  • Author
  • Member
  • 5 replies
  • August 28, 2024

Any update josh? It’s been almost 2 years.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings