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

Assertion message when Sentry is loaded twice in app #4566

Open
philipphofmann opened this issue Nov 22, 2024 · 2 comments
Open

Assertion message when Sentry is loaded twice in app #4566

philipphofmann opened this issue Nov 22, 2024 · 2 comments

Comments

@philipphofmann
Copy link
Member

Description

We fixed loading Sentry integration from the same binary with #4541, but when Sentry is loaded twice it still could happen that Sentry isn't working correctly. It would be great to detect this in the SDK, and consider logging an error or doing an assert to crash the app in debug. We had a customer who didn't realize they loaded Sentry twice, and it they didn't receive any crash reports cause the client was nil in the SentryCrashReportSink

SENTRY_LOG_ERROR(
@"Crash reports were found but no [SentrySDK.currentHub getClient] is set. "
@"Cannot send crash reports to Sentry. This is probably a misconfiguration, "
@"make sure you set the client with [SentrySDK.currentHub bindClient] before "
@"calling startCrashHandlerWithError:.");

@kahest
Copy link
Member

kahest commented Dec 4, 2024

Escalating critical issues such as this is captured in #4467

@kahest kahest closed this as completed Dec 4, 2024
@github-project-automation github-project-automation bot moved this from Needs Discussion to Done in Mobile & Cross Platform SDK Dec 4, 2024
@kahest kahest reopened this Dec 4, 2024
@kahest
Copy link
Member

kahest commented Dec 4, 2024

We should log an error when we detect that the SDK has been loaded twice (doesn't need to be an assert)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants