Skip to content
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

Merged
merged 24 commits into from
Apr 19, 2024

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Apr 12, 2024

#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

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Apr 12, 2024

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 24ab503

Copy link
Contributor

github-actions bot commented Apr 12, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 385.33 ms 456.41 ms 71.07 ms
Size 1.70 MiB 2.28 MiB 591.73 KiB

Previous results on branch: feat/hsm-19-push-isolation-scope-fork

Startup times

Revision Plain With Sentry Diff
8daa4ed 372.43 ms 444.45 ms 72.02 ms

App size

Revision Plain With Sentry Diff
8daa4ed 1.70 MiB 2.28 MiB 591.73 KiB

}

@Override
public @NotNull IScopes forkedCurrentScope(@NotNull String creator) {
Copy link
Member

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.

Copy link
Member Author

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() {
Copy link
Member

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?

Copy link
Member Author

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();
Copy link
Collaborator

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?

Copy link
Member Author

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");
Copy link
Collaborator

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

Copy link
Member Author

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

Base automatically changed from feat/hsm-18-push-scope-etc to 8.x.x April 19, 2024 12:15
@adinauer adinauer merged commit dd992aa into 8.x.x Apr 19, 2024
18 of 20 checks passed
@adinauer adinauer deleted the feat/hsm-19-push-isolation-scope-fork branch April 19, 2024 12:26
*
* @return scope
*/
public @NotNull IScope getScope();
Copy link
Collaborator

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();
Copy link
Collaborator

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

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 this pull request may close these issues.

3 participants