Skip to content

fix(sourcemaps): Prevent Debug ID collisions#3356

Open
szokeasaurusrex wants to merge 3 commits into
masterfrom
szokeasaurusrex/fix-empty-sourcemaps
Open

fix(sourcemaps): Prevent Debug ID collisions#3356
szokeasaurusrex wants to merge 3 commits into
masterfrom
szokeasaurusrex/fix-empty-sourcemaps

Conversation

@szokeasaurusrex

Copy link
Copy Markdown
Member

Generate Debug IDs from both the generated JS bytes and the sourcemap bytes when a sourcemap is available. This keeps distinct JS files from sharing a Debug ID when their maps are byte-identical, while preserving existing IDs already present in JS or sourcemaps.

Add a regression test for identical empty maps with distinct JS inputs. Update the sourcemaps inject snapshots because the injected Debug IDs and embedded source map payloads now change for every affected case.

Fixes #3350
Fixes CLI-341

@szokeasaurusrex szokeasaurusrex requested a review from a team as a code owner July 6, 2026 09:01
@linear-code

linear-code Bot commented Jul 6, 2026

Copy link
Copy Markdown

CLI-341

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Fixes

- Prevent Debug ID collisions ([#3356](https://github.com/getsentry/sentry-cli/pull/3356))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 4a24cba

@szokeasaurusrex szokeasaurusrex requested a review from JPeer264 July 6, 2026 09:02
Generate Debug IDs from both the generated JS bytes and the sourcemap bytes when a sourcemap is available. This keeps distinct JS files from sharing a Debug ID when their maps are byte-identical, while preserving existing IDs already present in JS or sourcemaps.

Add a regression test for identical empty maps with distinct JS inputs. Update the sourcemaps inject snapshots because the injected Debug IDs and embedded source map payloads now change for every affected case.

Fixes #3350
Fixes [CLI-341](https://linear.app/getsentry/issue/CLI-341/sentry-cli-mapping-identical-empty-source-maps-to-same-debug-id)
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/fix-empty-sourcemaps branch from a3465c5 to 3f96f9f Compare July 6, 2026 09:02
@szokeasaurusrex

Copy link
Copy Markdown
Member Author

@JPeer264 this change is needed to fix #3350, but it also will change all the debug IDs (i.e. the same sourcemap/minified file pair in the previous version will have a different debug ID after this update is released).

I am assuming that this is okay, but are you aware of any situation where this could break the product?

szokeasaurusrex added a commit that referenced this pull request Jul 6, 2026
Bump pinned GitHub-hosted runner labels to the newest GA images from actions/runner-images.

Also switch the OpenSSL bottle tag to tahoe so the x86_64 macOS 26 jobs can fetch bottles correctly.

Ref #3356
szokeasaurusrex added a commit that referenced this pull request Jul 6, 2026
Bump pinned GitHub-hosted runner labels to the newest GA images from actions/runner-images.

Use the x86_64 Homebrew command under Rosetta to fetch the Tahoe OpenSSL bottle for the macOS 26 jobs.

Ref #3356
szokeasaurusrex added a commit that referenced this pull request Jul 6, 2026
Bump pinned GitHub-hosted runner labels to the newest GA images from actions/runner-images.

Use the x86_64 Homebrew command under Rosetta to fetch the Tahoe OpenSSL bottle for the macOS 26 jobs.

Ref #3356

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That should be alright

szokeasaurusrex added a commit that referenced this pull request Jul 6, 2026
Bump pinned GitHub-hosted runner labels to the newest GA images from
actions/runner-images.

This updates Windows jobs to windows-2025 and macOS jobs to macos-26
while keeping Ubuntu on 24.04, which is still the newest GA Ubuntu
label.

Ref #3356
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.

Sentry CLI mapping identical empty source maps to same debug ID

3 participants