Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purchases.getOfferings() performance issue #755

Open
5 tasks done
hatem-72 opened this issue Oct 23, 2023 · 10 comments
Open
5 tasks done

Purchases.getOfferings() performance issue #755

hatem-72 opened this issue Oct 23, 2023 · 10 comments
Labels
bug Something isn't working triaged

Comments

@hatem-72
Copy link

hatem-72 commented Oct 23, 2023

Describe the bug
On IOS devices calling Purchases.getOfferings() is extremely slow. For exemple it takes up to 10 seconds on the Iphone 14 I have under my eyes. At least when called for the first time.

  1. Environment

    1. Platform: IOS
    2. SDK version: 7.1.0
    3. OS version: 16.4
    4. Xcode/Android Studio version: 14.3
    5. React Native version: 0.72.6
    6. SDK installation (CocoaPods + version or manual): CocoaPods ~> 1.13
  2. Debug logs that reproduce the issue

    Not relevant

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

const startTs = Date.now();
const offerings = await Purchases.getOfferings();
const endTs = Date.now();
console.log(`⏰ Revenue Cat: getOfferings took ${endTs - startTs}ms`);
// output: ⏰ Revenue Cat: getOfferings took 9454ms
  1. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

    I must say that I have about fifteen different offerings. And I am calling this method right after SDK setup in order to display a paywall on app opening.

    Not tested on Android yet.

@hatem-72 hatem-72 added the bug Something isn't working label Oct 23, 2023
@RCGitBot
Copy link
Contributor

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

@NachoSoto
Copy link
Contributor

Thanks for the report.

Could you please share logs when you reproduce this issue? Verbose logs would really help:
Purchases.logLevel = LogLevel.VERBOSE;

Please make sure they include everything starting from SDK initialization.

Thanks!

@hatem-72
Copy link
Author

hatem-72 commented Oct 23, 2023

Sure! Here are the RC logs on app opening:

LOG  Running "<app name>" with {"rootTag":1,"initialProps":{"isHeadless":false}}
DEBUG  [Revenue Cat] Log: ℹ️ Configuring SDK using RevenueCat's UserDefaults suite.
DEBUG  [Revenue Cat] Log: 👤 Identifying App User ID
DEBUG  [Revenue Cat] Log: ℹ️ Debug logging enabled
DEBUG  [Revenue Cat] Log: ℹ️ SDK Version - 4.28.0
DEBUG  [Revenue Cat] Log: ℹ️ Bundle ID - com.<app id>
DEBUG  [Revenue Cat] Log: ℹ️ System Version - Version 16.4 (Build 20E247)
DEBUG  [Revenue Cat] Log: ℹ️ Using a simulator. Ensure you have a StoreKit Config file set up before trying to fetch products or make purchases.
See https://errors.rev.cat/testing-in-simulator for more details.
DEBUG  [Revenue Cat] Log: 👤 Initial App User ID set
DEBUG  [Revenue Cat] Log: ℹ️ Purchases is configured with response verification disabled
DEBUG  [Revenue Cat] Log: ℹ️ Delegate set
DEBUG  [Revenue Cat] Log: ℹ️ Offerings cache is stale, updating from network in foreground
DEBUG  [Revenue Cat] Log: ℹ️ GetOfferingsOperation: Started
DEBUG  [Revenue Cat] Log: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/<user id>/offerings
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $idfa
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $idfv
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $ip
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $idfa
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $idfv
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $ip
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $idfa
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $idfv
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $ip
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $adjustId
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $mediaSource
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $campaign
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $adGroup
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $creative
DEBUG  [Revenue Cat] Log: ℹ️ API request started: GET '/v1/subscribers/<user id>/offerings'
LOG  🐣 Initializing Revenue Cat <-- My log here -->
WARN  [Revenue Cat] Log: ⚠️ The appUserID passed to logIn is the same as the one already cached. No action will be taken.
DEBUG  [Revenue Cat] Log: ℹ️ Vending CustomerInfo from cache.
DEBUG  [Revenue Cat] Log: ℹ️ CustomerInfo cache is stale, updating from network in foreground.
DEBUG  [Revenue Cat] Log: ℹ️ Network operation 'GetOfferingsOperation' found with the same cache key 'GetOfferingsOpe…'. Skipping request.
LOG  🐣 Initialized Revenue Cat in 129ms <-- My log here -->
DEBUG  [Revenue Cat] Log: ℹ️ API request completed: GET '/v1/subscribers/<user id>/offerings' (304)
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $firebaseAppInstanceId
DEBUG  [Revenue Cat] Log: ℹ️ No existing products cached, starting store products request for: [<list of 56 product ids>]
DEBUG  [Revenue Cat] Log: ℹ️ Found an existing request for products: [<list of 56 product ids>], appending to completion
DEBUG  [Revenue Cat] Log: ℹ️ GetOfferingsOperation: Finished
DEBUG  [Revenue Cat] Log: ℹ️ Serial request done: GET /v1/subscribers/<user id>/offerings, 0 requests left in the queue
DEBUG  [Revenue Cat] Log: ℹ️ GetCustomerInfoOperation: Started
DEBUG  [Revenue Cat] Log: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/<user id>
DEBUG  [Revenue Cat] Log: ℹ️ API request started: GET '/v1/subscribers/<user id>'
DEBUG  [Revenue Cat] Log: ℹ️ Network operation 'GetCustomerInfoOperation' found with the same cache key 'GetCustomerInfo…'. Skipping request.
DEBUG  [Revenue Cat] Log: ℹ️ API request completed: GET '/v1/subscribers/<user id>' (304)
DEBUG  [Revenue Cat] Log: 😻 CustomerInfo updated from network.
DEBUG  [Revenue Cat] Log: 😻 CustomerInfo updated from network.
DEBUG  [Revenue Cat] Log: ℹ️ GetCustomerInfoOperation: Finished
DEBUG  [Revenue Cat] Log: ℹ️ Serial request done: GET /v1/subscribers/<user id>, 0 requests left in the queue
LOG  ⏳ Revenue Cat: Calling getOfferings... <-- My log here -->
DEBUG  [Revenue Cat] Log: ℹ️ No cached Offerings, fetching from network
DEBUG  [Revenue Cat] Log: ℹ️ Offerings cache is stale, updating from network in foreground
DEBUG  [Revenue Cat] Log: ℹ️ GetOfferingsOperation: Started
DEBUG  [Revenue Cat] Log: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/<user id>/offerings
DEBUG  [Revenue Cat] Log: ℹ️ API request started: GET '/v1/subscribers/<user id>/offerings'
DEBUG  [Revenue Cat] Log: ℹ️ API request completed: GET '/v1/subscribers/<user id>/offerings' (304)
DEBUG  [Revenue Cat] Log: ℹ️ Found an existing request for products: [<list of 56 product ids>], appending to completion
DEBUG  [Revenue Cat] Log: ℹ️ GetOfferingsOperation: Finished
DEBUG  [Revenue Cat] Log: ℹ️ Serial request done: GET /v1/subscribers/<user id>/offerings, 0 requests left in the queue
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $idfa
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $idfv
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $ip
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $idfa
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $idfv
WARN  [Revenue Cat] Log: 🍎‼️ AdServices attribution token is not available in the simulator
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $ip
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $idfa
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $idfv
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $ip
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $adjustId
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $mediaSource
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $campaign
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $adGroup
DEBUG  [Revenue Cat] Log: ℹ️ setting reserved attribute: $creative
DEBUG  [Revenue Cat] Log: ℹ️ Vending CustomerInfo from cache.
DEBUG  [Device syncing] Successfully sync device with the server.
DEBUG  [Revenue Cat] Log: 😻 Store products request finished
DEBUG  [Revenue Cat] Log: 😻 Store products request received response
DEBUG  [Revenue Cat] Log: 😻 Offerings updated from network.
DEBUG  [Revenue Cat] Log: 😻 Offerings updated from network.
DEBUG  [Revenue Cat] Log: 😻 Offerings updated from network.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
DEBUG  [Revenue Cat] Log: ℹ️ This StoreProduct represents an SK1 product, the type of product cannot be determined, the value will be undefined. Use `StoreProduct.productCategory` instead.
LOG  ⏰ Revenue Cat: getOfferings took 6297ms <-- My log here -->

Note:

  • I have anonymized some references in logs (app name, user id, product ids)
  • I was using a simulator to make debugging easier, but the problem is the same on a real device and in production.

NachoSoto added a commit to RevenueCat/purchases-ios that referenced this issue Oct 23, 2023
`ProductFetcherSK1` had 2 public methods for fetching products: `products(withIdentifiers:completion:)` and `sk1Products(withIdentifiers:completion:)`.
Only one of them was using `TimingUtil` to log slow requests, and that one happened to not be used by `ProductsManager`, which means that we weren't getting these logs.

This is evident in RevenueCat/react-native-purchases#755. With this change, we'll now be able to see how long the product request took.
@NachoSoto
Copy link
Contributor

Thanks for that!

I just realized that with StoreKit 1 product requests we weren't correctly logging a warning if the product request takes too long. I fixed that in RevenueCat/purchases-ios#3327.

Unfortunately there isn't much we can do to optimize fetching products from StoreKit. 56 products is indeed a lot of products.

We'll make a new release with those logs so we can confirm that indeed this slowness is coming from there.

Can you explain your setup? We'd love to understand your motivation and use case for having ~15 offerings and 56 products to be able to think about how to best address this.

Thanks!

@hatem-72
Copy link
Author

hatem-72 commented Oct 24, 2023

Thank you for your response!

We have multiple offerings segmented by gender and age since we're working on a dating app. On top of that, we occasionally conduct in-house A/B testing, which accounts for the extensive number of products.

The issue I'm facing is that I already know which offering I intend to display in the paywall, thanks to a specific route on our server (GET /paywall/config). Therefore, I don’t need to access all 15 offerings or 56 products. However, I haven't found a way to directly retrieve a single offering from Revenue Cat, other than fetching products by their IDs. I'm hesitant to use the latter approach because it somewhat undermines the concept of offerings and would significantly complicate our paywall configuration.

Currently, my code looks like this:

const offeringId = await getOfferingFromServer(userId);
const offerings = await Purchases.getOfferings();
return offerings.all[offeringId];

Ideally, I'd prefer something more efficient like the following to reduce the data fetch overhead:

const offeringId = await getOfferingFromServer(userId);
const offering = await Purchases.getOffering(offeringId);
return offering;

NachoSoto added a commit to RevenueCat/purchases-ios that referenced this issue Oct 24, 2023
`ProductFetcherSK1` had 2 public methods for fetching products: `products(withIdentifiers:completion:)` and `sk1Products(withIdentifiers:completion:)`.
Only one of them was using `TimingUtil` to log slow requests, and that one happened to not be used by `ProductsManager`, which means that we weren't getting these logs.

This is evident in RevenueCat/react-native-purchases#755. With this change, we'll now be able to see how long the product request took.
NachoSoto added a commit to RevenueCat/purchases-ios that referenced this issue Oct 25, 2023
`ProductFetcherSK1` had 2 public methods for fetching products:
`products(withIdentifiers:completion:)` and
`sk1Products(withIdentifiers:completion:)`.
Only one of them was using `TimingUtil` to log slow requests, and that
one happened to not be used by `ProductsManager`, which means that we
weren't getting these logs.

This is evident in
RevenueCat/react-native-purchases#755. With
this change, we'll now be able to see how long the product request took.
@NachoSoto
Copy link
Contributor

That makes sense 👍🏻
Adding a new API to fetch a single Offering to optimize this use case is something we can do, but I can't promise anything about the timeframe right now. We'll keep this ticket open and update it when we add this API.

@nguyentuanit97
Copy link

Same issues, hope we can make it faster ASAP. Thanks for every effort!

@erwannbst
Copy link

Same issue

@qalqi
Copy link

qalqi commented Nov 13, 2023

Same issue!

@alexnguyen98
Copy link

Any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests

7 participants