POTEL 18 - Use correct SentryOptions for SentryClient constructor#3490
POTEL 18 - Use correct SentryOptions for SentryClient constructor#3490
SentryOptions for SentryClient constructor#3490Conversation
…pes-merge-2-add-scopes
…ainScopes to rootScopes
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- POTEL 18 - Use correct `SentryOptions` for `SentryClient` constructor ([#3490](https://github.com/getsentry/sentry-java/pull/3490))If none of the above apply, you can opt out of this check by adding |
Performance metrics 🚀
|
| final IScope rootIsolationScope = new Scope(options); | ||
|
|
||
| scopes.close(true); | ||
| globalScope.replaceOptions(options); |
There was a problem hiding this comment.
This diff looks like there was an auto-merge fail on a previous merge. It's just the options that are used for the SentryClient ctor that should be different.
| @@ -199,20 +199,16 @@ class InternalSentrySdkTest { | |||
|
|
|||
| @Test | |||
| fun `current scope returns obj when scopes is active`() { | |||
There was a problem hiding this comment.
Are these tests now testing something different? Should they be additions instead of replacements?
There was a problem hiding this comment.
With Sentry.close() in test setup, InternalSentrySdk.getCurrentScope() doesn't work correctly afair, so I used the actual setup code. Tests should still test the same thing now.
I just retested with the old code and it seems to work so maybe this was just an interim thing. I do however think the new code should be closer to real world usage, so I'd keep it this way.
wdyt?
📜 Description
Use
SentryOptionsfromrootScopesforSentryClientconstructor inSentry.init.💡 Motivation and Context
If
replaceOptionsnoops, the newSentryOptionsaren't actually used which meansSentryClientand the rest of the SDK have differentSentryOptionsin use.💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps