RevenueCat / react-native-purchases

React Native in-app purchases and subscriptions made easy. Support for iOS and Android.
https://www.revenuecat.com
MIT License
722 stars 81 forks source link

`purchasePackage` is never resolved nor rejected #579

Closed clauxx closed 1 year ago

clauxx commented 1 year ago

Description Starting with March the 6th, the Purchases.purchasePackage promise is neither resolved nor rejected. The purchases are going through from what we see in the dashboard, but the tracking we do whenever the promise is resolved never fires. The same behavior is observed in the sandbox environment, where the promise is not resolved/rejected. I noticed a similar bug mentioned in other issues, so wonder if that could be related.

  1. Environment
    1. Platform: iOS/Android
    2. SDK version: 5.12.0
    3. OS version: 16.0
    4. Xcode/Android Studio version: XCode 14.1
    5. React Native version: 0.67.5
    6. How widespread is the issue. Percentage of devices affected: It appears that all devices are affected.
  2. Debug logs that reproduce the issue:
    
    2023-03-15 11:12:50.489454+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: ℹ️ Configuring SDK using RevenueCat's UserDefaults suite.
    2023-03-15 11:12:50.491589+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: 👤 Identifying App User ID
    2023-03-15 11:12:50.499697+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: ℹ️ Debug logging enabled
    2023-03-15 11:12:50.499749+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: ℹ️ SDK Version - 4.17.7
    2023-03-15 11:12:50.499775+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: ℹ️ Bundle ID - com.justwatch.justwatch
    2023-03-15 11:12:50.499794+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: 👤 No initial App User ID
    2023-03-15 11:12:50.500772+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: ℹ️ Delegate set
    2023-03-15 11:12:50.516635+0100 JustWatch[7520:1896538] [Purchases] - DEBUG: ℹ️ GetCustomerInfoOperation: Started
    2023-03-15 11:12:50.516827+0100 JustWatch[7520:1896538] [Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request GET subscribers/CzdKVsJqEe2t7C5o1-1-EQ
    2023-03-15 11:12:50.521974+0100 JustWatch[7520:1896538] [Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/CzdKVsJqEe2t7C5o1-1-EQ
    2023-03-15 11:12:50.983920+0100 JustWatch[7520:1896546] [Purchases] - DEBUG: ℹ️ API request completed: GET /v1/subscribers/CzdKVsJqEe2t7C5o1-1-EQ (200)
    2023-03-15 11:12:50.993925+0100 JustWatch[7520:1896546] [Purchases] - DEBUG: ℹ️ Sending latest CustomerInfo to delegate.
    2023-03-15 11:12:50.994024+0100 JustWatch[7520:1896546] [Purchases] - DEBUG: 😻 CustomerInfo updated from network.
    2023-03-15 11:12:50.994064+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: ℹ️ Detected active subscriptions changed. Clearing trial or intro eligibility cache.
    2023-03-15 11:12:50.994099+0100 JustWatch[7520:1896546] [Purchases] - DEBUG: ℹ️ GetCustomerInfoOperation: Finished
    2023-03-15 11:12:50.994215+0100 JustWatch[7520:1896546] [Purchases] - DEBUG: ℹ️ Serial request done: GET subscribers/CzdKVsJqEe2t7C5o1-1-EQ, 0 requests left in the queue
    2023-03-15 11:12:50.994393+0100 JustWatch[7520:1896538] [Purchases] - DEBUG: ℹ️ GetOfferingsOperation: Started
    2023-03-15 11:12:50.994669+0100 JustWatch[7520:1896538] [Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request GET subscribers/CzdKVsJqEe2t7C5o1-1-EQ/offerings
    2023-03-15 11:12:50.996145+0100 JustWatch[7520:1896538] [Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/CzdKVsJqEe2t7C5o1-1-EQ/offerings
    2023-03-15 11:12:51.112465+0100 JustWatch[7520:1896545] [Purchases] - DEBUG: ℹ️ API request completed: GET /v1/subscribers/CzdKVsJqEe2t7C5o1-1-EQ/offerings (200)
    2023-03-15 11:12:51.114416+0100 JustWatch[7520:1896545] [Purchases] - DEBUG: ℹ️ No existing products cached, starting store products request for: ["jwpro"]
    2023-03-15 11:12:51.114723+0100 JustWatch[7520:1896545] [Purchases] - DEBUG: ℹ️ GetOfferingsOperation: Finished
    2023-03-15 11:12:51.114784+0100 JustWatch[7520:1896545] [Purchases] - DEBUG: ℹ️ Serial request done: GET subscribers/CzdKVsJqEe2t7C5o1-1-EQ/offerings, 0 requests left in the queue
    2023-03-15 11:12:51.114831+0100 JustWatch[7520:1896649] [Purchases] - DEBUG: ℹ️ No existing products cached, starting store products request for: ["jwpro"]
    2023-03-15 11:12:51.125708+0100 JustWatch[7520:1896339] [native] [Appboy sharedInstance].user.email =  cr.lungu@icloud.com
    2023-03-15 11:12:51.126148+0100 JustWatch[7520:1896339] [native] [Appboy sharedInstance].user.firstName =
    2023-03-15 11:12:51.141233+0100 JustWatch[7520:1896538] [Purchases] - WARN: ⚠️ The appUserID passed to logIn is the same as the one already cached. No action will be taken.
    2023-03-15 11:12:51.142809+0100 JustWatch[7520:1896538] [Purchases] - DEBUG: ℹ️ Vending CustomerInfo from cache.
    2023-03-15 11:12:51.144016+0100 JustWatch[7520:1896538] [Purchases] - DEBUG: ℹ️ GetOfferingsOperation: Started
    2023-03-15 11:12:51.144159+0100 JustWatch[7520:1896538] [Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request GET subscribers/CzdKVsJqEe2t7C5o1-1-EQ/offerings
    2023-03-15 11:12:51.150030+0100 JustWatch[7520:1896538] [Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/CzdKVsJqEe2t7C5o1-1-EQ/offerings
    [USERCENTRICS][DEBUG] Language: en
    2023-03-15 11:12:51.268270+0100 JustWatch[7520:1896546] [Purchases] - DEBUG: ℹ️ API request completed: GET /v1/subscribers/CzdKVsJqEe2t7C5o1-1-EQ/offerings (200)
    2023-03-15 11:12:51.268441+0100 JustWatch[7520:1896546] [Purchases] - DEBUG: ℹ️ Found an existing request for products: ["jwpro"], appending to completion
    2023-03-15 11:12:51.268478+0100 JustWatch[7520:1896546] [Purchases] - DEBUG: ℹ️ GetOfferingsOperation: Finished
    2023-03-15 11:12:51.268536+0100 JustWatch[7520:1896546] [Purchases] - DEBUG: ℹ️ Serial request done: GET subscribers/CzdKVsJqEe2t7C5o1-1-EQ/offerings, 0 requests left in the queue
    2023-03-15 11:12:51.548792+0100 JustWatch[7520:1896339] Bridge call to: deviceContexts
    [USERCENTRICS][DEBUG] Usercentrics SDK is fully initialized
    2023-03-15 11:12:51.741493+0100 JustWatch[7520:1896538] Reachability Flag Status: -R ------- reachabilityStatusForFlags
    2023-03-15 11:12:51.746965+0100 JustWatch[7520:1896339] [APPBOY] Successfully processed request to enable the SDK. The SDK will be enabled on the next call to startWithApiKey:.
    2023-03-15 11:12:51.747067+0100 JustWatch[7520:1896339] [native] [Appboy sharedInstance] changeUser with values CzdKVsJqEe2t7C5o1-1-EQ (null)
    2023-03-15 11:12:51.747137+0100 JustWatch[7520:1896339] [native] [Appboy sharedInstance].user addAlias with values aXMzYb5YEe2I7SY29plZQA jwId
    2023-03-15 11:12:51.747390+0100 JustWatch[7520:1896339] [native] [Appboy sharedInstance].user setCustomAttributeWithKey:AndStringValue: =  jwId
    2023-03-15 11:12:51.747986+0100 JustWatch[7520:1896339] [native] [Appboy sharedInstance].user.language =  en
    2023-03-15 11:12:51.749146+0100 JustWatch[7520:1896339] [native] [Appboy sharedInstance] logCustomEvent with eventName app_open
    2023-03-15 11:12:51.752274+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: ℹ️ Vending CustomerInfo from cache.
    2023-03-15 11:12:51.753709+0100 JustWatch[7520:1896538] 10.4.0 - [FirebaseAnalytics][I-ACS023012] Analytics collection enabled
    2023-03-15 11:12:51.754168+0100 JustWatch[7520:1896667] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:51.754266+0100 JustWatch[7520:1896667] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:51.754335+0100 JustWatch[7520:1896667] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:51.754576+0100 JustWatch[7520:1896667] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:51.755061+0100 JustWatch[7520:1896538] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:51.755214+0100 JustWatch[7520:1896538] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:51.755412+0100 JustWatch[7520:1896538] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:51.755577+0100 JustWatch[7520:1896538] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:51.761746+0100 JustWatch[7520:1896667] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:51.761887+0100 JustWatch[7520:1896667] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:51.761982+0100 JustWatch[7520:1896667] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:51.762290+0100 JustWatch[7520:1896667] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:51.764558+0100 JustWatch[7520:1896667] [connection] nw_connection_copy_protocol_metadata_internal_block_invoke [C27] Client called nw_connection_copy_protocol_metadata_internal on unconnected nw_connection
    2023-03-15 11:12:51.764581+0100 JustWatch[7520:1896667] [connection] nw_connection_copy_protocol_metadata_internal_block_invoke [C27] Client called nw_connection_copy_protocol_metadata_internal on unconnected nw_connection
    2023-03-15 11:12:51.764594+0100 JustWatch[7520:1896667] [connection] nw_connection_copy_protocol_metadata_internal_block_invoke [C27] Client called nw_connection_copy_protocol_metadata_internal on unconnected nw_connection
    2023-03-15 11:12:51.764606+0100 JustWatch[7520:1896667] [connection] nw_connection_copy_protocol_metadata_internal_block_invoke [C27] Client called nw_connection_copy_protocol_metadata_internal on unconnected nw_connection
    2023-03-15 11:12:51.764618+0100 JustWatch[7520:1896667] [connection] nw_connection_copy_connected_local_endpoint_block_invoke [C27] Client called nw_connection_copy_connected_local_endpoint on unconnected nw_connection
    2023-03-15 11:12:51.764684+0100 JustWatch[7520:1896667] [connection] nw_connection_copy_connected_remote_endpoint_block_invoke [C27] Client called nw_connection_copy_connected_remote_endpoint on unconnected nw_connection
    2023-03-15 11:12:51.764696+0100 JustWatch[7520:1896667] [connection] nw_connection_copy_connected_path_block_invoke [C27] Client called nw_connection_copy_connected_path on unconnected nw_connection
    2023-03-15 11:12:51.764833+0100 JustWatch[7520:1896667] [connection] nw_connection_copy_protocol_metadata_internal_block_invoke [C27] Client called nw_connection_copy_protocol_metadata_internal on unconnected nw_connection
    2023-03-15 11:12:51.765146+0100 JustWatch[7520:1896667] [connection] nw_connection_copy_protocol_metadata_internal_block_invoke [C27] Client called nw_connection_copy_protocol_metadata_internal on unconnected nw_connection
    2023-03-15 11:12:51.765969+0100 JustWatch[7520:1896667] [connection] nw_flow_add_write_request [C27 www.justwatch.com:443 failed parent-flow (satisfied (Path is satisfied), interface: en0, ipv4, dns)] cannot accept write requests
    2023-03-15 11:12:51.765996+0100 JustWatch[7520:1896667] [connection] nw_write_request_report [C27] Send failed with error "Socket is not connected"
    2023-03-15 11:12:51.766269+0100 JustWatch[7520:1896667] [connection] nw_connection_copy_metadata_block_invoke [C27] Client called nw_connection_copy_metadata on unconnected nw_connection
    2023-03-15 11:12:51.777330+0100 JustWatch[7520:1896538] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:51.777618+0100 JustWatch[7520:1896538] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:51.777877+0100 JustWatch[7520:1896538] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:51.778322+0100 JustWatch[7520:1896538] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:51.844333+0100 JustWatch[7520:1896666] [Purchases] - DEBUG: 😻 Store products request finished
    2023-03-15 11:12:51.844547+0100 JustWatch[7520:1896666] [Purchases] - DEBUG: 😻 Store products request request received response
    2023-03-15 11:12:57.643600+0100 JustWatch[7520:1896339] -[GCKNNetworkReachability localWiFiStatusForFlags:] - WiFi reachability, GCKNNetworkReachability.m:359
    2023-03-15 11:12:57.650148+0100 JustWatch[7520:1896339] +[GCKNNetworkUtils selectNetworkInterfaceForMulticastFromInterfaces:allowIPv6:] - Selected interface: en0(:12) type:3 172.16.3.230/255.255.252.0 BSSID:(null) SSID:'(null)' flags:34915 MTU:1500 active, GCKNNetworkUtils.m:269
    2023-03-15 11:12:57.656292+0100 JustWatch[7520:1896339] -[GCKNNetworkReachability localWiFiStatusForFlags:] - WiFi reachability, GCKNNetworkReachability.m:359
    2023-03-15 11:12:57.662757+0100 JustWatch[7520:1896339] +[GCKNNetworkUtils selectNetworkInterfaceForMulticastFromInterfaces:allowIPv6:] - Selected interface: en0(:12) type:3 172.16.3.230/255.255.252.0 BSSID:(null) SSID:'(null)' flags:34915 MTU:1500 active, GCKNNetworkUtils.m:269
    2023-03-15 11:12:58.642804+0100 JustWatch[7520:1896339] -[GCKNNetworkReachability localWiFiStatusForFlags:] - WiFi reachability, GCKNNetworkReachability.m:359
    2023-03-15 11:12:58.650589+0100 JustWatch[7520:1896339] +[GCKNNetworkUtils selectNetworkInterfaceForMulticastFromInterfaces:allowIPv6:] - Selected interface: en0(:12) type:3 172.16.3.230/255.255.252.0 BSSID:(null) SSID:'(null)' flags:34915 MTU:1500 active, GCKNNetworkUtils.m:269
    2023-03-15 11:12:59.143906+0100 JustWatch[7520:1896667] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:59.144136+0100 JustWatch[7520:1896667] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:59.144207+0100 JustWatch[7520:1896667] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:59.144779+0100 JustWatch[7520:1896667] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:59.147082+0100 JustWatch[7520:1896537] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:59.147184+0100 JustWatch[7520:1896537] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:59.147260+0100 JustWatch[7520:1896537] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:59.147339+0100 JustWatch[7520:1896537] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:59.202905+0100 JustWatch[7520:1896649] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:59.203008+0100 JustWatch[7520:1896649] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:12:59.203417+0100 JustWatch[7520:1896649] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:12:59.203497+0100 JustWatch[7520:1896649] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:13:00.432320+0100 JustWatch[7520:1896712] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:13:00.432424+0100 JustWatch[7520:1896712] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:13:00.432780+0100 JustWatch[7520:1896712] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:13:00.432860+0100 JustWatch[7520:1896712] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:13:02.226022+0100 JustWatch[7520:1896339] [native] [Appboy sharedInstance] logCustomEvent with eventName userinteraction
    2023-03-15 11:13:02.227913+0100 JustWatch[7520:1896666] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:13:02.228061+0100 JustWatch[7520:1896666] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:13:02.228388+0100 JustWatch[7520:1896666] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:13:02.229821+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: ℹ️ Vending Offerings from cache
    2023-03-15 11:13:02.230323+0100 JustWatch[7520:1896666] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:13:02.230751+0100 JustWatch[7520:1896666] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:13:02.230821+0100 JustWatch[7520:1896666] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:13:02.230882+0100 JustWatch[7520:1896666] 10.4.0 - [FirebaseAnalytics][I-ACS035001] Cannot create Value type with unsupported value. The Value has to be NSNumber, NSString or NSArray (if supported). Value: (nil)
    2023-03-15 11:13:02.231199+0100 JustWatch[7520:1896666] 10.4.0 - [FirebaseAnalytics][I-ACS018015] Event parameter value must be of type NSString, NSNumber or NSArray. Type: NSNull
    2023-03-15 11:13:02.232390+0100 JustWatch[7520:1896339] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
    2023-03-15 11:13:02.232783+0100 JustWatch[7520:1896339] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
    2023-03-15 11:13:02.232994+0100 JustWatch[7520:1896339] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
    2023-03-15 11:13:02.233142+0100 JustWatch[7520:1896339] [Purchases] - WARN: ⚠️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
    2023-03-15 11:13:02.237200+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: ℹ️ Vending Offerings from cache
    2023-03-15 11:13:02.237924+0100 JustWatch[7520:1896339] [Purchases] - INFO: 💰 Purchasing Product 'jwpro' from package in Offering 'default'
    2023-03-15 11:13:02.240469+0100 JustWatch[7520:1896667] [Purchases] - DEBUG: ℹ️ StoreKit1Wrapper (0x0000000282df3a20) updatedTransaction: jwpro 0
    2023-03-15 11:13:02.241445+0100 JustWatch[7520:1896724] [AppsFlyerSDK] [com.facebook.react.RNAppsFlyerQueue] AppsFlyer SDK version 6.8.1 started build (86)
    2023-03-15 11:13:02.241614+0100 JustWatch[7520:1896724] [AppsFlyerSDK] [com.facebook.react.RNAppsFlyerQueue] Keychain items migration status: 0
    2023-03-15 11:13:02.242138+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: ℹ️ setting values for attributes: ["$appsflyerId"]
    2023-03-15 11:13:04.294038+0100 JustWatch[7520:1896722] [connection] nw_resolver_start_query_timer_block_invoke [C34.1] Query fired: did not receive all answers in time for graph.facebook.com:443
    2023-03-15 11:13:04.294553+0100 JustWatch[7520:1896722] [connection] nw_resolver_start_query_timer_block_invoke [C35.1] Query fired: did not receive all answers in time for graph.facebook.com:443
    2023-03-15 11:13:09.828513+0100 JustWatch[7520:1896722] 10.4.0 - [FirebaseAnalytics][I-ACS800014] Cannot get flag for unregistered flag. SDK name, flag name: app_measurement, session_stitching_token_feature_enabled
    2023-03-15 11:13:09.999745+0100 JustWatch[7520:1896666] 10.4.0 - [FirebaseAnalytics][I-ACS800014] Cannot get flag for unregistered flag. SDK name, flag name: app_measurement, session_stitching_token_feature_enabled
    2023-03-15 11:13:21.374489+0100 JustWatch[7520:1896666] [tcp] tcp_input [C15.1.1:3] flags=[R] seq=3741739478, ack=0, win=0 state=LAST_ACK rcv_nxt=3741739478, snd_una=1947016541
    2023-03-15 11:13:21.376241+0100 JustWatch[7520:1896666] [tcp] tcp_input [C15.1.1:3] flags=[R] seq=3741739478, ack=0, win=0 state=CLOSED rcv_nxt=3741739478, snd_una=1947016541
    2023-03-15 11:13:21.376488+0100 JustWatch[7520:1896666] [tcp] tcp_input [C15.1.1:3] flags=[R] seq=3741739478, ack=0, win=0 state=CLOSED rcv_nxt=3741739478, snd_una=1947016541
    2023-03-15 11:13:25.224922+0100 JustWatch[7520:1896339] [Purchases] - DEBUG: ℹ️ applicationDidBecomeActive
4. Steps to reproduce, with a description of expected vs. actual behavior
a. Configure RevenueCat with `Purchases.configure ({ apiKey })`
b. Make purchase
```ts
        const offerings: PurchasesOfferings = await Purchases.getOfferings();

        if (offerings?.current?.availablePackages.length) {
          const offer = offerings.current.monthly;

          if (offer) {
            try {
              const purchaseMade = await Purchases.purchasePackage(offer);
              if (
                purchaseMade &&
                typeof purchaseMade.customerInfo.entitlements.active.Pro !==
                  "undefined"
              ) {
                // Track purchase
              }
           }
         }

Expected The purchasePackage promise resolves/rejects. The purchase is successful and appears in the Dashboard.

Actual The purchasePackage never resumes execution. No errors are thrown and the value is never resolved. The purchase is still successful and appears in the Dashboard, we just don't know about it in the app.

  1. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.) Related issues: [1] [2] [3]
RCGitBot commented 1 year ago

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

NachoSoto commented 1 year ago

Thanks for the detailed report! Looks like there's a lot of Firebase noise, it seems to be intercepting some Objective-C calls. Are you able to reproduce this issue if you disable Firebase?

mahmoudAllam93 commented 1 year ago

@NachoSoto i tried this solution but it is not working i use storeKit1 as storeKit2 rejected from apple as purchase package return receipt is missing

dustinr-hstk commented 1 year ago

Ahh didn't realize there was a react-native-purchase issue already open about this. We are having the same issue and I posted about it in the purchases-ios project of a similar issue.

Ours is with Purchases.purchaseProduct and the function call hangs because the function promise never resolves. However, its inconsistent. This is how we are using it, when it hangs the catch and finally block never run. But we it runs successfully they do. So something weird about the error handler? Or maybe retry logic?

async function purchaseFanSubscription(vars: PurchaseSubscriptionVariables) {
    if (!offeringQuery.data) {
      console.warn(
        'Tried to purchase fan subscription before offerings data was loaded. Ensure that the data is loaded on the component level before calling purhcaseFanSubscription.',
      )
      return
    }
    await Purchases.purchaseProduct(vars.productId)
      .catch((err) => {
        console.log(err)
        console.log('caught an error in the purchase product call')
      })
      .finally(async () => {
        console.log('finally is running')
        await forceTokenRefresh()
        await invalidateIapUserInfoQuery()
      })
    // Token should now have up to date account information
  }
dustinr-hstk commented 1 year ago

We did come up with a work around for now and Im sure it can be adapted for the original issue. But it seems like even though it hangs it still makes the purchase. So we used a setInterval and polled the customer info looking for our product and then returned after that or if the call is successful just use the actually successfully resolved promise.


async function purchaseFanSubscription(vars: PurchaseSubscriptionVariables) {
    // return new Promise<void>()
    if (!offeringQuery.data) {
      console.warn(
        'Tried to purchase fan subscription before offerings data was loaded. Ensure that the data is loaded on the component level before calling purhcaseFanSubscription.',
      )
      return
    }

    const customerInfoCheck = setInterval(async () => {
      const customerInfo = await Purchases.getCustomerInfo()
      if (
        customerInfo.activeSubscriptions.find((it) => it === vars.productId)
      ) {
        console.log(
          'purchaseFanSubscription customerInfoCheck found product id during a hang',
        )
        clearInterval(customerInfoCheck)
        await forceTokenRefresh()
        await invalidateIapUserInfoQuery()
        return
      }
    }, 2000)

    await Purchases.purchaseProduct(vars.productId)
      .finally(async () => {
        console.log('finally is running')
        clearInterval(customerInfoCheck)
        await forceTokenRefresh()
        await invalidateIapUserInfoQuery()
      })
    // Token should now have up to date account information
  }
clauxx commented 1 year ago

Thanks for the detailed report! Looks like there's a lot of Firebase noise, it seems to be intercepting some Objective-C calls. Are you able to reproduce this issue if you disable Firebase?

Yes, it still persists.

NachoSoto commented 1 year ago

Is there a chance you could stop the app with Xcode's debugger when this happens to see if there's any thread blocked?

clauxx commented 1 year ago

@NachoSoto so straange, it worked now in the sandbox. With a bit of a delay (a few seconds), but the promise was resolved. Please don't close the issue though, cause it still seems like our users have this problem.

kyle-ssg commented 1 year ago

We are evaluating for the first time and are definitely seeing Purchases.purchaseProduct never resolving regardless of the purchase actually being successful(The sandbox success alert) and customer info being updated.

    const purchase = await Purchases.purchasePackage(aPackage)
    console.log('never gets called')

If I understand correctly, the current hypothesis is that it's to do with DeviceCache? I'm not sure whether it's related but also activeSubscriptions required a force close of the app to be removed from active subscriptions regardless of calls to Purchases.getCustomerInfo.

Happy to try out a new version of purchases-ios to validate things are working our end.

clauxx commented 1 year ago

@NachoSoto are there any updates on this from your side?

NachoSoto commented 1 year ago

I'm going to be releasing an update to the react-native-purchases in a bit with the latest version of purchases-ios that includes https://github.com/RevenueCat/purchases-ios/pull/2375 I'll let you know when it's out so you can test it since it might fix your issue 👍🏻

NachoSoto commented 1 year ago

Version 5.13.2 is out. Could you test with that and let us know if you can still reproduce this? 🙏🏻

jojost1 commented 1 year ago

I have the same issue but with purchases-ios. After calling Purchases.shared.purchase(package: product) { (transaction, customerInfo, error, userCancelled) in the callback never gets executed but it does purchase the product successfully.

Purchases.shared.purchase(package: product) { (transaction, customerInfo, error, userCancelled) in
    // This is never called
    unlockPro = true
}
NachoSoto commented 1 year ago

For those that ran into this issue: could you confirm that you had code inside of your Purchases.addCustomerInfoUpdateListener that called Purchases.getCustomerInfo? That would have led to a deadlock, and it will be fixed in the next released: https://github.com/RevenueCat/purchases-ios/pull/2412

deborahshda commented 9 months ago

Hi, I am still getting this issue in version 7.0.0. Not getting a response even though the product is purchased successfully. Works fine for in app products but not for subscriptions. This is in android. Any ideas on how to move forward? This is very integral. Any help would really be appreciated!

ilyasbat commented 8 months ago

the same problem still persists. any solution?

TheEndurance commented 8 months ago

@NachoSoto Seems like many others continue to get this issue, I am on version 6.7.0 and having the same problem still on android.

NachoSoto commented 8 months ago

It'd be really helpful if you could open a new issue providing all the data we need: logs, code, platform versions, etc.