sentry-electron icon indicating copy to clipboard operation
sentry-electron copied to clipboard

`electron.net` breadcrumbs are recorded for sending Sentry envelopes:

Open timfish opened this issue 3 years ago • 3 comments

Versions + Platform

Description

electron.net breadcrumbs are recorded for sending Sentry envelopes: image

This code attempts to stop this but isn't working for some reason: https://github.com/getsentry/sentry-electron/blob/cfeacf652bf6fdc8c026d2a6684ab9fcab733d6b/src/main/integrations/net-breadcrumbs.ts#L137-L139

timfish avatar Mar 30 '22 18:03 timfish

This is a strange one since I can't reproduce this locally 🤔

timfish avatar Mar 31 '22 12:03 timfish

Seems like the request headers are only added for the store endpoint and node? https://github.com/getsentry/sentry-javascript/blob/db661b4ca60f5bce3ba3e587722b4b1a2643dc9b/packages/core/src/api.ts#L147-L167

Can we grab details about the dsn/URL from options and try to match that way?

AbhiPrasad avatar Mar 31 '22 14:03 AbhiPrasad

Seems like the request headers are only added for the store endpoint and node?

I ran the e2e tests and logged the headers at the test server and logged at the point where we bail out for Sentry requests and everything I saw was as expected

Can we grab details about the dsn/URL from options and try to match that way?

Yep, that might be more reliable.

timfish avatar Mar 31 '22 14:03 timfish

Now I'm thinking it may be related to the ordering/execution here: https://github.com/getsentry/sentry-electron/blob/75a3b3bbd0ce98f2506b74d3a2b3cf55b11ed2cf/src/main/integrations/net-breadcrumbs.ts#L134-L139

originalRequestMethod.apply is calling and starting the request. I'm only actually seeing electron.net breadcrumbs for failed requests. If the request fails, maybe the headers are missing and the check fails?

timfish avatar Mar 31 '22 15:03 timfish