Skip to content

fix(browser): Avoid 4xx response for succesful diagnoseSdkConnectivity request #16840

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

Merged
merged 2 commits into from
Jul 8, 2025

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jul 8, 2025

Our browser SDKs expose a diagnoseSdkConnectivity function, whose primary purpose is to be called by the example pages injected via the wizard. As reported in #16226, even a successful request to Sentry (i.e. no ad blockers or other parties blocked the request) gets logged to the console because the previous URL included an invalid public key (as well as org id). This did not cause a fetch error but just a 400 (bad request) response. However, browsers log 4xx fetch requests to the console and users mistook this console log for an incorrectly configured SDK setup.

This PR now changes the key to a valid but deactivated public key in a new project in the sentry-sdks org. All of the information in this URL is public and as safe to share as any DSN. So from this perspective, I don't see concerns (happy to reconsider if reviewers have concerns). It seems like we return 200 even for deactivated keys, which means that now, there's no console log anymore for successful requests.

closes #16226

@Lms24 Lms24 self-assigned this Jul 8, 2025
@Lms24 Lms24 requested review from mydea, Litarnus and AbhiPrasad July 8, 2025 11:38
@Lms24 Lms24 marked this pull request as ready for review July 8, 2025 11:38
@Lms24 Lms24 changed the title fix(browser): Avoid 4xx response for succesful diagnoseSdkConnectivity tests fix(browser): Avoid 4xx response for succesful diagnoseSdkConnectivity request Jul 8, 2025
Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

makes sense to me 👍

@Lms24 Lms24 merged commit 95c4fe3 into develop Jul 8, 2025
129 checks passed
@Lms24 Lms24 deleted the lms/fix-browser-diagnose-sdk-connectivity-url branch July 8, 2025 12:40
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.

SvelteKit Demo + Sentry wizard: Sentry.diagnoseSdkConnectivity() bad request (is this actually expected?)
3 participants