Skip to content

Add globalHubMode to options#3805

Merged
adinauer merged 3 commits into8.x.xfrom
feat/global-hub-mode-option
Oct 21, 2024
Merged

Add globalHubMode to options#3805
adinauer merged 3 commits into8.x.xfrom
feat/global-hub-mode-option

Conversation

@adinauer
Copy link
Copy Markdown
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

@github-actions
Copy link
Copy Markdown
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

@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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 👍

return;
}

final boolean globalHubModeToUse =
Copy link
Copy Markdown
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
Copy Markdown
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

@adinauer adinauer merged commit 5b8c172 into 8.x.x Oct 21, 2024
@adinauer adinauer deleted the feat/global-hub-mode-option branch October 21, 2024 04:06
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