Skip to content

Conversation

@bitsandfoxes
Copy link
Contributor

The SDK will no longer attempt to reinstall the backend without native support enabled and without successful initialization.
It'll also capture EntryPointNotFoundException during reinstallation.

public static void ReinstallBackend() => SentryNativeBridge.ReinstallBackend();
// We're calling this in `BeforeSceneLoad` instead of `SubsystemRegistration` as it's too soon and the
// SignalHandler would still get overwritten.
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have had this in here all along? :)
I dont' recall why we left on SentryInitialization originally, do you recall?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention was to have everything annotated RuntimeInitializeOnLoadMethod in the SentryInitialization.cs so users could overwrite/remove it. But it should have belonged in SentryNative all along.

Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually though the flag was "UseNativeBackend" which we'll flip to false if native support was disabled, but also, on the catch block for the MissingEntryPoint.

And we can check that flag before doing any native calls. Or we don't need this because no native call is done anyway because we don't add the scope observers?

So the only thing left is making sure the BeforeScene thing doesn't run, hence the boolean you used in this PR? If that's the case there's no need to write LogDebug( "something failed") because nothing failed, just no backend was selected.

And no need for flipping any flag on the catch block either if no where else after this we'll need to know if it worked or not. (We could disable sessions if we're afraid of reporting 100% crash free rate, so the user will at least see a drop in sessions if it's a widespread error)?

bitsandfoxes and others added 3 commits November 13, 2024 12:17
Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
@bitsandfoxes
Copy link
Contributor Author

Or we don't need this because no native call is done anyway because we don't add the scope observers?

Exactly, if the init failed we don't add the observers and we won't reinstall the backend.

So the only thing left is making sure the BeforeScene thing doesn't run, hence the boolean you used in this PR? If that's the case there's no need to write LogDebug( "something failed") because nothing failed, just no backend was selected.

Yes. Fair point. Updated the logs! Thanks!

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.

4 participants