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

fix: Include sentry_key in ping URL so it does not end up in breadcrumbs #576

Merged

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Oct 13, 2022

When using fetch to communicate with the main process, we include sentry_key in the URL so that it does not result in a fetch breadcrumb.

It appears this was left off of the ping "command" resulting in a breadcrumb!

@@ -13,7 +13,7 @@ function getImplementation(): IPCInterface {

logger.log('IPC was not configured in preload script, falling back to custom protocol and fetch');

fetch(`${PROTOCOL_SCHEME}://${IPCChannel.PING}`).catch(() =>
fetch(`${PROTOCOL_SCHEME}://${IPCChannel.PING}/sentry_key`).catch(() =>
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn’t this be a query string and not part of the path?

Copy link
Collaborator Author

@timfish timfish Oct 13, 2022

Choose a reason for hiding this comment

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

It doesn't matter since the fetch breadcrumb checking matches the entire url!

In the main process, the protocol handler returns an empty response for anything that isn't scope or event.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We already use this to exclude event and scope messages but it was left off ping!

fetch(`${PROTOCOL_SCHEME}://${IPCChannel.SCOPE}/sentry_key`, { method: 'POST', body: scope }).catch(() => {

Copy link
Member

Choose a reason for hiding this comment

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

Ahhhh I see, thanks for clarifying.

@timfish timfish merged commit c7c0dd6 into getsentry:master Oct 13, 2022
@timfish timfish deleted the fix/sentry-ping-in-fetch-breadcrumbs branch November 18, 2022 17:27
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.

2 participants