-
-
Notifications
You must be signed in to change notification settings - Fork 427
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
Hubs/Scopes Merge 38 - Use ScopeType.COMBINED
for cross platform (InternalSentrySdk
)
#3375
Hubs/Scopes Merge 38 - Use ScopeType.COMBINED
for cross platform (InternalSentrySdk
)
#3375
Conversation
…pes-merge-2-add-scopes
…ainScopes to rootScopes
|
@@ -44,9 +45,9 @@ public final class InternalSentrySdk { | |||
@Nullable | |||
public static IScope getCurrentScope() { | |||
final @NotNull AtomicReference<IScope> scopeRef = new AtomicReference<>(); | |||
// TODO [HSM] should this retrieve combined scope? |
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.
Yes, at least until cross-platform SDKs support separate scope types themselves.
@@ -431,8 +433,7 @@ public void setPropagationContext(@NotNull PropagationContext propagationContext | |||
|
|||
@Override | |||
public @NotNull IScope clone() { | |||
// TODO [HSM] just return a new CombinedScopeView with forked scope? | |||
return getDefaultWriteScope().clone(); | |||
return new CombinedScopeView(globalScope, isolationScope.clone(), scope.clone()); |
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 idea here is to have a clone that doesn't change the original so we're safer by cloning both isolation and current scope.
@@ -454,7 +455,6 @@ public void bindClient(@NotNull ISentryClient client) { | |||
|
|||
@Override | |||
public @NotNull ISentryClient getClient() { | |||
// TODO [HSM] checking for noop here doesn't allow disabling via client, is that ok? |
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.
Discussed internally with backend team, if a customer needs this, they can provide their own noop ISentryClient
that isn't actually NoOpSentryClient
and thus not detected here.
@@ -4,7 +4,5 @@ public enum ScopeType { | |||
CURRENT, | |||
ISOLATION, | |||
GLOBAL, | |||
|
|||
// TODO [HSM] do we need a combined as well so configureScope |
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.
Yes, at least for cross platform SDKs until they support different scope types separately themselves.
@@ -646,9 +646,7 @@ public void withScope(final @NotNull ScopeCallback callback) { | |||
|
|||
} else { | |||
final @NotNull IScopes forkedScopes = forkedCurrentScope("withScope"); | |||
// TODO [HSM] should forkedScopes be made current inside callback? |
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.
Yes, I'd expect Sentry.setTag to operate on the forked scopes inside withScope
Performance metrics 🚀
|
@@ -138,14 +139,17 @@ class InternalSentrySdkTest { | |||
) | |||
// TODO [HSM] add breadcrumbs to all scopes and assert they are there |
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.
Is this comment still relevant?
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.
No, already removed.
#skip-changelog
📜 Description
To send values from all scope types (global, isolation, current) to cross platform SDKs we use
ScopeType.COMBINED
for.configureScope
to retrieve all tags, breadcrumbs etc.💡 Motivation and Context
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps