-
-
Notifications
You must be signed in to change notification settings - Fork 444
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 19 - Add pushIsolationScope
and fork methods
#3343
Conversation
…pes-merge-2-add-scopes
|
Performance metrics 🚀
|
} | ||
|
||
@Override | ||
public @NotNull IScopes forkedCurrentScope(@NotNull String creator) { |
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.
l
: I'm wondering if we should have method overloads here instead. E.g. .forkedScope(ScopeType type)
, Same could be done for the getters.
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.
Hmm this could be confusing as I think we should always fork current scope whenever we fork isolation scope and having .forkedScope(ISOLATION)
fork both seems odd.
} | ||
|
||
@Override | ||
public @NotNull IScope getScope() { |
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.
What's the reason for adding those getters?
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.
This was part of the RFC, not sure it's actually needed. It somewhat contradicts what we discussed in one of our meetings where someone said the idea of .configureScope
was to make it harder to hold a reference to the scope.
We can remove them again and see if we actually need them, then re-add.
@@ -539,6 +539,11 @@ public void removeExtra(final @NotNull String key) { | |||
return NoOpScopesStorage.NoOpScopesLifecycleToken.getInstance(); | |||
} | |||
|
|||
@Override | |||
public @NotNull ISentryLifecycleToken pushIsolationScope() { | |||
return NoOpScopesStorage.NoOpScopesLifecycleToken.getInstance(); |
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.
Shouldn't this also be Sentry.pushIsolationScope()
? Same as in HubAdapter?
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.
Hub
should be removed before releasing the major IMO.
@@ -602,12 +593,28 @@ public ISentryLifecycleToken pushScope() { | |||
.log(SentryLevel.WARNING, "Instance is disabled and this 'pushScope' call is a no-op."); | |||
return NoOpScopesStorage.NoOpScopesLifecycleToken.getInstance(); | |||
} else { | |||
Scopes scopes = this.forkedCurrentScope("pushScope"); | |||
final @NotNull IScopes scopes = this.forkedCurrentScope("pushScope"); |
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.
Comment on method regarding the return of a lifecycle token can be removed
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.
Already removed in a follow up PR
* | ||
* @return scope | ||
*/ | ||
public @NotNull IScope getScope(); |
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.
public
keyword can be removed
* | ||
* @return isolation scope | ||
*/ | ||
public @NotNull IScope getIsolationScope(); |
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.
public
keyword can be removed
#skip-changelog
📜 Description
💡 Motivation and Context
pushIsolationScope
forks both current and isolation scope and makes them the current scopes.💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps