getsentry / sentry-cocoa

The official Sentry SDK for iOS, tvOS, macOS, watchOS.
https://sentry.io/for/cocoa/
MIT License
813 stars 329 forks source link

Xcode 16.1 swizzleCoreData hangs main thread #4527

Open mitko25522 opened 1 week ago

mitko25522 commented 1 week ago

Platform

iOS

Environment

Develop

Installed

CocoaPods

Version

8.40.1

Xcode Version

16.1

Did it work on previous versions?

No response

Steps to Reproduce

  1. Fetch some core data objects
  2. Observe the Issue navigator for Hangs

Expected Result

There shouldn't be a warning that the main thread is hanging.

Actual Result

When fetching core data objects I get a warning that the swizzle method is causing the main thread to hang:

Performing I/O on the main thread by reading or writing to a database can cause hangs.

Image

Are you willing to submit a PR?

No response

brustolin commented 1 week ago

Hello @mitko25522, thanks for reaching out.

The swizzled function is called in the same thread the original call is made. Are you fetching this data also in the main thread?

mitko25522 commented 1 week ago

Hello @brustolin, thank you for the quick reply and the information. There might be a case where we are fetching the data in the main thread. I will check.