sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

Calling `addBreadcrumb` triggers `Main Thread Checker` warning

Open ncltg opened this issue 1 year ago • 9 comments

Platform

iOS

Environment

Develop

Installed

Swift Package Manager

Version

8.26.0

Xcode Version

15.2

Did it work on previous versions?

not sure

Steps to Reproduce

Call SentrySDK.addBreadcrumb() from a background thread

Expected Result

No main thread checker issue is found.

Actual Result

Result

Xcode shows a Main Thread checker warning. The SDK is calling UIKit methods that require Main Thread execution on a background thread.

Logs and screenshots

Main Thread Checker: UI API called on a background thread: -[UIWindow screen]
PID: 45981, TID: 2549765, Thread name: (none), Queue name: com.apple.root.user-initiated-qos.cooperative, QoS: 25
Screenshot 2024-05-24 at 13 03 51 Screenshot 2024-05-24 at 13 03 42

Question

I checked the iOS documentation and it does not mention that breadcrumb should be added from the main thread. Is it an issue from Sentry SDK that needs to be addressed or does it actually recommended to call that method from the main thread ?

Are you willing to submit a PR?

No response

ncltg avatar May 24 '24 11:05 ncltg