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

Check for mixed SDK versions #4270

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

adinauer
Copy link
Member

📜 Description

  • Checks SentryIntegrationPackageStorage.packages for mixed versions when sending out an envelope.
  • Caches the decision so the check is only performed once*
    • invalidates the cache when a new package is added

This is only the first step where we log when mixed versions have been detected.
Next step is to not enable the SDK in that case.

💡 Motivation and Context

First step for solving #4132

💚 How did you test it?

📝 Checklist

  • 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.
  • I updated the wizard 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 Mar 20, 2025

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

- Check for mixed SDK versions ([#4270](https://github.com/getsentry/sentry-java/pull/4270))

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 a8875cf

Copy link
Contributor

github-actions bot commented Mar 20, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 408.00 ms 475.67 ms 67.67 ms
Size 1.58 MiB 2.22 MiB 653.31 KiB

Previous results on branch: feat/detect-mixed-sdk-versions

Startup times

Revision Plain With Sentry Diff
f1edfce 351.51 ms 381.63 ms 30.11 ms

App size

Revision Plain With Sentry Diff
f1edfce 1.58 MiB 2.22 MiB 653.31 KiB

Copy link
Member

@lcian lcian left a comment

Choose a reason for hiding this comment

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

LGTM

for (SentryPackage pkg : packages) {
if (pkg.getName().startsWith("maven:io.sentry:")
&& !sdkVersion.equalsIgnoreCase(pkg.getVersion())) {
logger.log(
Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking if we should introduce a method that force-logs regardless of the debug and diagnosticLevel values set and use it here, wdyt?

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.

4 participants