Open anyarik opened 1 week ago
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Hi @anyarik, I'll have our SDK team look into this. In the meantime, can you confirm this happens with a fresh test user? Sometimes older test users with lots of transactions on their receipt can cause this network behavior in sandbox.
Describe the bug When I try on Apple TV to renew the subscription in the sandbox, I encounter a network error indicating "The network connection was lost". This issue only occurs when Apple requests for account password. If you attempt to renew the subscription immediately after the error, the subscription will go through successfully (provided that the Apple ID password input window was not displayed).
During the very first payment (with the payment history cleared for the account) in the sandbox, the subscription process goes through successfully.
The bug occurs in the following code block used for subscription:
Environment
Debug logs that reproduce the issue <SKPaymentQueue: 0x30084f520>: Payment completed with error: Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSErrorFailingURLStringKey=https://sandbox.itunes.apple.com/WebObjects/MZFinance.woa/wa/com.apple.jingle.app.finance.DirectAction/accountSummary?hardwareModel=AppleTV14%2C1&os=tvOS&applicationUsername=140&offerName=com.flixsnip.month&clientCorrelationKey=65D27514-1F0B-4BFE-9291-30037036C918&guid=00008110-00061CA01A81401E&quantity=1&hardwareFamily=AppleTV&xToken=BgIAAAEBFAACmgUAAAAAZmlURXSwn1RkOylNAtH2ljr0x%2Bi8fVHD&vid=65EC9846-23E6-4A9E-A7F6-FE3063789BBB&osBuildNumber=21L580&osVersion=17.5.1&bvrs=4&generateBuyParams=true&bid=com.flixsnip.flixsnip&receipt-data=… DEBUG: ℹ️ StoreKit1Wrapper (0x0000000302e9edc0) updatedTransaction: com.flixsnip.month (The network connection was lost.) 2 ERROR: 😿‼️ A network error has occurred. The network connection was lost. INFO: 💰 Finishing transaction 'CB9DF6BD-3598-4FF8-84A6-A1F5D4E04233' for product 'com.flixsnip.month' ERROR: 💰 Product purchase for 'com.flixsnip.month' failed with error: Error Domain=RevenueCat.ErrorCode Code=10 "A network error has occurred. The network connection was lost." UserInfo={readable_error_code=NETWORK_ERROR, source_file=RevenueCat/PurchasesOrchestrator.swift:802, sourcefunction=handleFailedTransaction(:), NSLocalizedDescription=A network error has occurred. The network connection was lost., NSUnderlyingError=0x3044d8ea0 {Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSLocalizedDescription=The network connection was lost., NSUnderlyingError=0x3044c1fe0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-4, NSErrorPeerAddressKey={length = 16, bytes = 0x100201bb1124cafe0000000000000000}}}}}} DEBUG: ℹ️ StoreKit1Wrapper (0x0000000302e9edc0) removedTransaction: com.flixsnip.month (The network connection was lost.) ["NSUnderlyingError": Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-4, NSErrorPeerAddressKey={length = 16, bytes = 0x100201bb1124cafe0000000000000000}}, "NSLocalizedDescription": The network connection was lost.] 2 'Subscription processing error:', [Error: A network error has occurred. The network connection was lost.]
Steps to reproduce, with a description of expected vs. actual behavior
Expected behavior The app should allow users to renew their subscription without any network errors.
Actual behavior The app throws a network error when users try to renew their subscription after cancellation.
https://github.com/RevenueCat/react-native-purchases/assets/5025252/cbee40a0-6cab-41b2-a0dd-55af4242cf4a
Additional context