RevenueCat/purchases-ios

macOS App hanging for at least 2000 ms because of check for macOS app running on the main thread.

Opened this issue · 3 comments

Describe the bug
A clear and concise description of what the bug is. The more detail you can provide the faster our team will be able to triage and resolve the issue. Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.

  1. Environment
    1. Platform: macOS
    2. SDK version: 4.40.1
    3. StoreKit version:
      • StoreKit 1
      • StoreKit 2 (enabled with usesStoreKit2IfAvailable(true))
    4. OS version: Sonoma 14.1.1
    5. Xcode version: 15.3
    6. Device and/or simulator:
      • Device
      • Simulator
    7. Environment:
      • Sandbox
      • TestFight
      • Production
    8. How widespread is the issue. Percentage of devices affected. 100% users.
  2. Debug logs that reproduce the issue. Complete logs with Purchases.logLevel = .verbose will help us debug this issue.
All good in debug, it only happens in production and in the App Store.
  1. Steps to reproduce, with a description of expected vs. actual behavior
  • Create a new macOS project.
  • Add revenueCat framework.
  • Set environment to prod.
  • Need to fiddle a little bit with the revenueCat SDK to make sure MapAppStoreDetector is called.

App hangs at status = SecStaticCodeCheckValidity
Screenshot 2024-05-06 at 22 28 15

It throws the following warning when running locally:
Screenshot 2024-04-22 at 15 37 56

  1. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
    Problem seems to be related to this code status = SecStaticCodeCheckValidity running on the main thread.

  2. Additional context
    It only happens on the App Store.

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

@jb-apps thanks for reporting! We'll get it fixed

Sorry it took so long, but the fix is merged and will be a part of next release!