fix: collect main thread data synchronously during init #744
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After adding the exception handling to SentryInitialization.cs, I've noticed it doesn't collect any of the usual context. This fixes that (and maybe a few other very early user-space error captures). The original behaviour was to run the main thread info collection asynchronously in a coroutine. Now, we collect it right away during init.
Before
https://sentry.io/organizations/sentry-sdks/issues/3267829133/events/2651b13a859b4859860b3f44859ffacd/?project=5439417
After
https://sentry.io/organizations/sentry-sdks/issues/3267829133/events/e12e6634035b4eb0bdc3c4349a5d03e1/?project=5439417