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 42d - Close previous scopes before binding a new global client #3404

Merged
merged 52 commits into from May 7, 2024

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented May 2, 2024

📜 Description

💡 Motivation and Context

When calling close on the previous scopes after a new client has already been bound to the global scope, the new client is closed and Sentry does not capture events anymore.

💚 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

adinauer and others added 30 commits March 27, 2024 16:30
import kotlin.test.Test

class MetricsIntegrationTest {

@BeforeTest
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test started becoming flaky. Not sure why exactly.

Copy link
Contributor

github-actions bot commented May 2, 2024

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Hubs/Scopes Merge 42d - Close previous scopes before binding a new global client ([#3404](https://github.com/getsentry/sentry-java/pull/3404))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against dee2203

Copy link
Contributor

github-actions bot commented May 2, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 580.90 ms 698.31 ms 117.41 ms
Size 1.70 MiB 2.28 MiB 595.65 KiB

Previous results on branch: feat/hsm-42d-close-bind-client-ordering

Startup times

Revision Plain With Sentry Diff
dd4548a 337.77 ms 436.57 ms 98.80 ms

App size

Revision Plain With Sentry Diff
dd4548a 1.70 MiB 2.28 MiB 595.70 KiB

Base automatically changed from feat/hsm-42-remove-hub to 8.x.x May 2, 2024 13:17
it.dsn = dsn
}
verify(scopes).close(eq(true))
assertTrue(Sentry.getGlobalScope().client.isEnabled)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also check that Sentry.getCurrentScopes() has an enabled client?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We basically already are. It'd be more of a duplicate of tests already present in ScopesTest / CombinedScopeViewTest. I think it's fine as is.

Copy link
Collaborator

@lbloder lbloder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
One question on test

@adinauer adinauer merged commit e7007dd into 8.x.x May 7, 2024
9 of 20 checks passed
@adinauer adinauer deleted the feat/hsm-42d-close-bind-client-ordering branch May 7, 2024 04:37
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.

None yet

2 participants