-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: Add OptionConfiguration
to replace Runtime/BuildTime
#1888
Conversation
|
samples/unity-of-bugs/Assets/Scripts/SentryOptionConfiguration.cs
Outdated
Show resolved
Hide resolved
83d68eb
to
3c7e7b1
Compare
OptionConfiguration
OptionConfiguration
to replace Runtime/BuildTime
samples/unity-of-bugs/Assets/Scripts/SentryOptionConfiguration.cs
Outdated
Show resolved
Hide resolved
options.SampleRate = 1.0f; | ||
// Here you can programmatically modify the Sentry option properties used for the SDK's initialization | ||
|
||
#if UNITY_ANDROID || UNITY_IOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just make the C# layer initialize the native layer by default?
And make this "Native inits first" thing be opt-in? It seems still hard for folks to understand what's going on, even with the comments below. (I don't expect a beginner to get it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be simpler but we would lose on the ability to catch native exceptions happening at startup. Is that worth it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see a point for: If you've got plugins that might crash the app before the Unity game starts you can opt-in the native first init and still have full coverage.
If you don't then are those native crashes/exceptions be even actionable for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see a point for: If you've got plugins that might crash the app before the Unity game starts you can opt-in the native first init and still have full coverage.
Wouldn't that mean we still need to keep the buildtime native configuration generator (which I understand Bruno was suggesting we could remove)?
If you don't then are those native crashes/exceptions be even actionable for you?
Even the information that there are startup crashes is valuable IMO.
Overall, I wouldn't change this - it does provide value (startup crashes) even though it does make things a little more complicated IF users need to adapt these settings programmatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've summarized my ideas in #1907
Maybe you can take a look? The idea is to have the auto-init be opt-in. Reduce friction and confusion for those that don't need it but still provide the feature for those that do.
src/Sentry.Unity.Editor/ConfigurationWindow/OptionsConfigurationTab.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Runtime/BuildTime config got deprecated but will still be called last as keep backwards compatibility. I've updated the config window with a warning label.
What do you think about only showing the new option on the UI by default and only show the original options (i.e. as in the screenshot), when any of the original options are actually set in the existing config?
options.SampleRate = 1.0f; | ||
// Here you can programmatically modify the Sentry option properties used for the SDK's initialization | ||
|
||
#if UNITY_ANDROID || UNITY_IOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be simpler but we would lose on the ability to catch native exceptions happening at startup. Is that worth it?
After giving it a try I think that's fair. I've updated the window logic. |
Co-authored-by: Bruno Garcia <[email protected]>
…ntry-unity into feat/options-config
Co-authored-by: Bruno Garcia <[email protected]>
Fixes #1621
Based on the issue description: The aim is to have users no longer need to know or care about
Runtime
andBuildTime
differences. They write their code in once place, we use the same options at any time.Platform specifics can be controlled via the Unity precompile directives. We include a sample of those with the generated template:
The Runtime/BuildTime config got deprecated but will still be called last as keep backwards compatibility. I've updated the config window with a warning label that shows as long as there are either Runtime or BuildTime configs.