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

fix(oom): Ensure UIKit APIs are not called from background threads #409

Merged
merged 1 commit into from
Sep 17, 2019

Conversation

kattrali
Copy link
Contributor

@kattrali kattrali commented Sep 13, 2019

The normal flow is to install on the main thread, immediately after app
launch to ensure as many errors and crashes are captured as possible.
However, some mobile development frameworks may prevent this flow,
instead only allowing initialization later or on a background queue. In
these cases, the library should still work and not emit additional
warnings.

Prior to this change, background initialization using Bugsnag.start()
would be detected by the main thread sanitizer as UI API usage.

Fixes bugsnag/bugsnag-react-native#396

Tests

While I didn't find a good way to automate the check (as it only fires in an interactive debugging environment), I verified the change manually to ensure that it is only called on main now.

The normal flow is to install on the main thread, immediately after app
launch to ensure as many errors and crashes are captured as possible.
However, some mobile development frameworks may prevent this flow,
instead only allowing initialization later or on a background queue. In
these cases, the library should still work and not emit additional
warnings.

Prior to this change, background initialization using Bugsnag.start()
would be detected by the main thread sanitizer as UI API usage.
@kattrali kattrali merged commit e1b5842 into master Sep 17, 2019
@kattrali kattrali deleted the kattrali/fix-bg-init branch September 17, 2019 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ios warning: UI API called on a background thread
1 participant