fix(browser): Avoid 4xx response for succesful diagnoseSdkConnectivity
request
#16840
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 afetch
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