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

Ensure `collect_sourcemap_references` does not associate the same sourcemap with multiple source files

Open szokeasaurusrex opened this issue 9 months ago • 0 comments

collect_sourcemap_references can in some cases associate the same sourcemap with multiple source files, which should not happen. One of these cases will be addressed in #2438; here we should add additional logic to ensure we don't guess the same sourcemap is associated with more than one minified source.

We will do this as follows:

  • Do two passes over the minified sources. First, we pass over all of the sources with source mapping URLs, then we pass over all of the sources without source mapping URLs
  • As we identify sourcemaps, remove them from the set of sourcemaps that have not been associated with a source yet, so that we cannot add the same sourcemap to multiple files (this applies when guessing the sourcemap references; if two minified sources contain the same source mapping URL, we will associate both sources with the same sourcemap)

szokeasaurusrex avatar Mar 27 '25 13:03 szokeasaurusrex