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

Merged
merged 5 commits into from
Mar 27, 2025
Merged

Check for mixed SDK versions #4270

merged 5 commits into from
Mar 27, 2025

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Mar 20, 2025

#skip-changelog
Changelog is written in a follow up PR

📜 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

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

Generated by 🚫 dangerJS against 76ae6cb

Copy link
Contributor

github-actions bot commented Mar 20, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 412.39 ms 442.96 ms 30.57 ms
Size 1.58 MiB 2.22 MiB 653.10 KiB

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

Startup times

Revision Plain With Sentry Diff
dd09760 408.00 ms 475.67 ms 67.67 ms
f1edfce 351.51 ms 381.63 ms 30.11 ms
0376116 388.63 ms 437.71 ms 49.08 ms

App size

Revision Plain With Sentry Diff
dd09760 1.58 MiB 2.22 MiB 653.31 KiB
f1edfce 1.58 MiB 2.22 MiB 653.31 KiB
0376116 1.58 MiB 2.22 MiB 653.14 KiB

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?

}

public @NotNull Set<SentryPackage> getPackages() {
return packages;
}

public boolean checkForMixedVersions(final @NotNull ILogger logger) {
Copy link
Member

Choose a reason for hiding this comment

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

I guess would be nice to have a test for this (if not yet)

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah will PR one

@adinauer adinauer merged commit c6e6bbc into main Mar 27, 2025
35 of 36 checks passed
@adinauer adinauer deleted the feat/detect-mixed-sdk-versions branch March 27, 2025 10:29
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