Skip to content

Warn when Sentry.init() options with semantic effect are passed as undefined #14261

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

Closed
lforst opened this issue Nov 13, 2024 · 1 comment · Fixed by #14450
Closed

Warn when Sentry.init() options with semantic effect are passed as undefined #14261

lforst opened this issue Nov 13, 2024 · 1 comment · Fixed by #14450
Assignees
Milestone

Comments

@lforst
Copy link
Member

lforst commented Nov 13, 2024

Description

As pre-work to #13262 where we want to change the behavior of Sentry.init() options being passed as undefined not having an effect, we want to first start warning people that this behavior will change soon.

I would probably do this even when debug: false. Remember that any console.log()s need to be wrapped in a console sandbox.

@lforst lforst added this to the 9.0.0 milestone Nov 13, 2024
@mydea mydea self-assigned this Nov 25, 2024
mydea added a commit that referenced this issue Nov 25, 2024
This PR updates & streamlines our handling of certain `undefined`
options:

First, we do not want to differentiate anymore between options being
unset and set to `undefined` - the resulting behavior should be the
same. This especially applies to the tracing options `tracesSampleRate`,
`tracesSampler` and `enableTracing` - if any of those is set to
`undefined`, `hasEnabledTracing()` will be true and certain things will
happen.

In v9, we want to change this so that `undefined` will also result in
`hasEnabledTracing() === false`. We'll warn if we encounter such a
scenario.

Another related thing this PR does is streamline how we handle falsy
values for `environment`, `release` and `dist` on an event. Today, we go
out of our way to check if the properties are set and only update them
accordingly. However, fasly values do not make sense for these fields
anyhow, so we can streamline this a bit and simply check for truthiness
to determine if we want to use event, option, or default values.

Closes #14261
Copy link
Contributor

A PR closing this issue has just been released 🚀

This issue was referenced by PR #14450, which was included in the 8.41.0 release.

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 a pull request may close this issue.

2 participants