Skip to content

feat!: Add sourcemap and catch-all variants to DebugImage - #1347

Open
timfish wants to merge 2 commits into
getsentry:masterfrom
timfish:fix/sourcemap-debug-image
Open

timfish wants to merge 2 commits into
getsentry:masterfrom
timfish:fix/sourcemap-debug-image

Conversation

@timfish

@timfish timfish commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

JavaScript SDKs attach debug_meta.images[{ "type": "sourcemap", ... }] to every event once a bundler plugin injects debug IDs. DebugImage had no such variant and no catch-all, so Envelope::from_slice failed on the event item and consumers such as tauri-plugin-sentry dropped every frontend event.

This adds a SourceMap variant for the sourcemap type and an untagged Other(Map<String, Value>) variant that keeps the full object of any image type the SDK does not know about, so it round-trips unchanged. DebugImage is now #[non_exhaustive] so future variants do not break downstream code again.

This is a breaking change for code that matches DebugImage exhaustively, so it targets the next minor release.

Fixes #1267

JavaScript SDKs attach `sourcemap` debug images to every event when
debug IDs are injected at build time. `DebugImage` had no such variant
and no catch-all, so the whole envelope failed to deserialize.

Add a `SourceMap` variant for the `sourcemap` type and an untagged
`Other` variant that keeps the full object of any unknown image type.
Mark the enum `#[non_exhaustive]` so future variants are not breaking.

Fixes getsentry#1267
@timfish
timfish marked this pull request as ready for review October 8, 2026 11:57
@timfish
timfish requested a review from a team as a code owner October 8, 2026 11:58
@timfish timfish changed the title fix(types): Add sourcemap and catch-all variants to DebugImage feat!: Add sourcemap and catch-all variants to DebugImage Oct 8, 2026

@szokeasaurusrex szokeasaurusrex 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.

Lgtm in general, deferring official approval & merge until we are ready for the next breaking release (likely within next few months) 🤞

@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.37%. Comparing base (a57b91c) to head (f475ec9).
⚠️ Report is 188 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1347      +/-   ##
==========================================
+ Coverage   73.81%   74.37%   +0.56%     
==========================================
  Files          64       79      +15     
  Lines        7538    10048    +2510     
==========================================
+ Hits         5564     7473    +1909     
- Misses       1974     2575     +601     

This branch has not been deployed

No deployments
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.

DebugImage has no sourcemap variant, so events carrying JS debug IDs fail to deserialize

2 participants