getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
37.72k stars 4.05k forks source link

Code mapping doesn't work with backslashes #73018

Open InterstellarStella opened 1 month ago

InterstellarStella commented 1 month ago

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

  1. Have the GitHub, GitLab or BitBucket integration installed in Sentry
  2. Have an event with backslashes in its stacktrace paths
  3. Set up code mapping either manually through the integration settings or through the UI modal in the event

Expected Result

The code mapping works.

Actual Result

The code mapping doesn't work in either case.

Through the UI modal:

image

Note that there are no errors thrown when we hit "Save", as this was fixed here.

Product Area

Settings - Integrations

Link

No response

DSN

No response

Version

No response

┆Issue is synchronized with this Jira Improvement by Unito

getsantry[bot] commented 1 month ago

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] commented 1 month ago

Routing to @getsentry/product-owners-settings-integrations for triage ⏲️

getsantry[bot] commented 1 month ago

Routing to @getsentry/product-owners-issues for triage ⏲️

MichaelSun48 commented 1 month ago

Hi @InterstellarStella! I believe this falls within this known issue where we intentionally do not try to code-map source paths or stacktrace filepaths that contain only one file and no directories. This is because allowing single file matches would dramatically increase the potential for false code mappings.

In the example you shared, the source code path contains only the file index.js, which is a good example of why we chose to implement it this way since index.js is an extremely common file name - we want to make sure there's more overlap between the strack trace file path and the source path before we create a connection between the two, and there's no overlap to compare if either one contains only a single file.

That being said, this also could be a legitimately missed edge case that I'd like to investigate. Could you share the issue that that this is happening in so I can take a look for myself?

InterstellarStella commented 2 weeks ago

Hi @MichaelSun48 sorry for the late response. I added some more details regarding the original customer case in the linked shadow ticket. Please let me know if you need more information!

MichaelSun48 commented 2 weeks ago

No worries @InterstellarStella, I'll respond to you internally about this in a moment!