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

Change access modifier to private for stack trace mode option setter #1806

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tustanivsky
Copy link
Collaborator

This PR should prevent users from accidentally enabling Enhanced stack trace mode via the SentryUnityOptions parent class property. Enhanced mode is not supported in IL2CPP builds (see #1033 for more details) and thus could cause crashes like in #1783.

Closes #1783

@tustanivsky tustanivsky changed the title fix: change access modifier for stack trace mode option Change access modifier to private for stack trace mode option setter Sep 18, 2024
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.

Looks like the whole property was private though (getter and setter). We're making the getter public but the setter private. Is this helping somehow?

@@ -7,6 +7,10 @@
- Contexts, such as `device` and `gpu` that the SDK retrieves during the game's startup is now available even earlier and irrespective whether an error was captured on the main or on a background thread ([#1802](https://github.com/getsentry/sentry-unity/pull/1802))
- Added an `ApplicationNotRespondingException` type that allows filtering of ANR events ([#1800](https://github.com/getsentry/sentry-unity/pull/1800))

### Fixes

- Change access modifier to `private` for stack trace mode option setter ([#1806](https://github.com/getsentry/sentry-unity/pull/1806))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Change access modifier to `private` for stack trace mode option setter ([#1806](https://github.com/getsentry/sentry-unity/pull/1806))
- Change access modifier of `StackTraceMode` to `private` to avoid pitfall ([#1806](https://github.com/getsentry/sentry-unity/pull/1806))

@bitsandfoxes
Copy link
Contributor

What we wanted to achieve was take away the footgun for users to switch mode and break their game by hiding the property. But it's still accessible via the base class. With this we're giving the "no-footgun!" attempt a second chance.

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.

WebGL exception during IL2CPP processing
3 participants