feat(core): Update & deprecate undefined
option handling
#14450
Merged
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.
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 optionstracesSampleRate
,tracesSampler
andenableTracing
- if any of those is set toundefined
,hasEnabledTracing()
will be true and certain things will happen.In v9, we want to change this so that
undefined
will also result inhasEnabledTracing() === 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
anddist
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