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

Add globalHubMode to options #3805

Open
wants to merge 3 commits into
base: 8.x.x
Choose a base branch
from
Open

Conversation

adinauer
Copy link
Member

📜 Description

globalHubMode used to only be a param on Sentry.init. To make it easier to be used in e.g. Desktop environments, we now additionally added it as an option on SentryOptions that can also be set via sentry.properties.

We can consider deprecating and removing the Sentry.init overloads that have the globalHubMode parameter.

If both the param on Sentry.init and the option are set, the option will win. By default the option is set to null meaning whatever is passed to Sentry.init wins.

💡 Motivation and Context

Fixes #3779

💚 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 Oct 18, 2024

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

Generated by 🚫 dangerJS against 3c39dac

Copy link
Contributor

github-actions bot commented Oct 18, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 403.92 ms 405.76 ms 1.84 ms
Size 1.70 MiB 2.36 MiB 671.41 KiB

Previous results on branch: feat/global-hub-mode-option

Startup times

Revision Plain With Sentry Diff
c68229e 392.73 ms 462.64 ms 69.90 ms

App size

Revision Plain With Sentry Diff
c68229e 1.70 MiB 2.36 MiB 671.38 KiB

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 👍

@@ -279,10 +278,12 @@ private static void init(final @NotNull SentryOptions options, final boolean glo
return;
}

final boolean globalHubModeToUse =
Copy link
Collaborator

Choose a reason for hiding this comment

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

(l) getting an IDE warning here for a possible null-pointer due to options.isGlobalHubMode changing between checks. We could extract a final Boolean globalHubModeFromOptions = options.isGlobalHubMode() and use that in the ternary operator

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yeah, forgot to do that, will update

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