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

Newer sandbox non-subscription purchase takes precedence over older production purchase

Open danielpunkass opened this issue 6 months ago • 1 comments

  1. Environment

    1. Platform: iOS
    2. SDK version: main branch
    3. StoreKit version:
      • [ ] StoreKit 1 (default on versions <5.0.0. Can be enabled in versions >=5.0.0 with .with(storeKitVersion: .storeKit1))
      • [x] StoreKit 2 (default on versions >=5.0.0)
    4. OS version: n/a
    5. Xcode version: n/a
    6. Device and/or simulator:
      • [x] Device
      • [] Simulator (not an issue because the sandbox value is respected)
    7. Environment:
      • [x] Sandbox
      • [x] TestFlight
      • [x] Production
    8. How widespread: I believe the problem would affect any customers who have purchased a production non-subscription SKU and then for whatever reason purchased the same SKU again in TestFlight.
  2. Ask if really needed but I don't think you'll need them.

  3. Steps to reproduce, with a description of expected vs. actual behavior

    1. Arrange for a customer to have two purchases of the same non-subscription item. One, in production, should be dated earlier than one in sandbox.
    2. In code, request the latest customer info.
    3. Examine the CustomerInfoResponse.Subscriber.allPurchasesByID and see that the only non-subscription purchase represented in the list is from the sandbox.
  4. In this scenario, the entitlements.activeInCurrentEnvironment value ends up not listing the entitlement corresponding to the production purchase, presumably because it was stripped in the process of building the entitlements array.

danielpunkass avatar Jun 17 '25 17:06 danielpunkass

👀 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 Jun 17 '25 17:06 RCGitBot

Hey @danielpunkass,

I apologize for the delay here. After taking a look at your description, I would recommend checking the following documentation, which explains how to control which users get access to entitlements in a Sandbox environment to prevent the propagation to Production.

Hope this helps!

mawr92 avatar Oct 02 '25 19:10 mawr92

Thanks, I wasn't really looking for a workaround. I was trying to help improve the underlying framework by reporting a bug. If RevenueCat engineers don't think it's an issue worth pursuing, that's fine. But I wasn't reporting this for customer support.

danielpunkass avatar Oct 02 '25 21:10 danielpunkass

Hey @danielpunkass,

Thank you for the clarification, and thank you for the PR you created. We really appreciate your collaboration! The team is not planning to make any changes to this logic as of right now, but they will consider your suggestions. I'll go ahead and close this issue now. Please feel free to create a new one if you would like to make further suggestions or need help with any of our SDKs! 🚀

mawr92 avatar Oct 03 '25 20:10 mawr92