Transaction Identifiers do not match in Sandbox for iOS
- [X] I have updated Purchases SDK to the latest version
- [X] I have read the Contribution Guidelines
- [X] I have searched the Community
- [X] I have read docs.revenuecat.com
- [X] I have searched for existing Github issues
Describe the bug For iOS Sandbox transactions, the "transaction_id" field in the webhook is something like "StoreKitTest_Transaction_7d5df4466d669078a079d2c0d58f65d9_3" while in-app the result of purchaseProduct will have transactionIdentifier equal to just "3". I'm expecting these two things to match up for some fulfillment logic.
- Environment
- Platform: iOS
- SDK version: 8.2.1
- OS version: iOS 18.0 (also tried in 16.4)
- Xcode/Android Studio version:
- React Native version: 0.73.6
- SDK installation (CocoaPods + version or manual):
- How widespread is the issue. Percentage of devices affected.
- Debug logs that reproduce the issue
- Steps to reproduce, with a description of expected vs. actual behavior
- Call purchaseProduct for a consumable product in iOS simulator
- Examine result.transaction.transactionIdentifier
- Expected: this value is unique and matches the txn id in the webhook request
- Actual: this value is not unique and does not match the txn id in the webhook request
- Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Additional context N/A
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
This is expected behavior. When using StoreKit configuration files, the transaction IDs provided by StoreKit are sequential numbers (1, 2, 3), which reset every time you start a new simulator. On the backend, we need to generate unique IDs, which is why you see a different one in the webhook.
One thing to note is that the suffix in the webhook's transaction ID (_1) matches the StoreTransaction.transactionId returned by the SDK.
When a StoreKit config file is not used, the transactionId would match the one in corresponding webhook event
I was hoping you could override that identifier in the app-side to have it matched, but that's fine. Not a big deal.