getsentry / getsentry/sentry-rust

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

Open
#1,267 5 comments 0 reactions 0 assignees View on GitHub
breaking change Improvement Rust
Dominant language
Rust
Stars
752
Forks
190
Avg merge
1h 21m
Merged PRs (30d)
5

Description

### How do you use Sentry?

Sentry SaaS (sentry.io)

### SDK version

0.42.0

### Steps to reproduce

1. Build a Tauri 2 app that uses `tauri-plugin-sentry`, so the browser SDK
routes envelopes to the Rust SDK over IPC.
2. Build the frontend with `@sentry/vite-plugin` active (default config), which
injects per-chunk debug IDs.
3. Throw an error in the frontend.

Minimal reproducer from the original report:
https://github.com/ottosson/sentry-vite-plugin-repro

Once debug IDs are injected, `@sentry/browser` attaches
`debug_meta.images[{ "type": "sourcemap", ... }]` to every event.

### Expected result

The event deserializes and is sent, as it does when the bundler plugin is absent
or `sourcemaps: { disable: true }` is set.

### Actual result

`symbolic` / `proguard` / `wasm`, with no `sourcemap` variant and no catch-all.
`Envelope::from_slice` eagerly parses the event item, hits the unknown variant,
and returns `InvalidItemPayload`.

Downstream, `tauri-plugin-sentry`'s `if let Ok(...)` has no error arm, so 100%
of frontend events are dropped with no diagnostic. Rust-side panics keep
arriving, so the project looks healthy while all JS telemetry is gone.

This was root-caused in detail by @ottosson here (2026-06-02):
https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/916
Cross-posted at https://github.com/timfish/sentry-tauri/issues/35

Both threads are on the bundler plugin's tracker, but the change has to happen
in this crate and I couldn't find an issue here, so I'm filing one.

Verified against master today: still no variant. Same at 0.42.0 and 0.46.2, so
a version bump doesn't help.

Suggested fix, either or ideally both:

1. Add the variant. The wire name is `sourcemap`, not snake_case `source_map`,
so it needs an explicit `#[serde(rename = "sourcemap")]`.
2. Add a catch-all so an unknown image type can't fail the whole event. This is
the more valuable half: this enum deserializes data produced by other Sentry
SDKs on independent release cycles, so a future variant will do this again.

Attribution note: both suggested fixes above are @ottosson's, from the linked
comment on bundler-plugins#916, including the Other(Map) catch-all
and the observation that the Context enum in this same file already has one. I'm
filing here because the change belongs in this crate and I couldn't find an issue
for it on this tracker.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the DebugImage and Context enums in the Rust crate and inspect the existing event deserialization coverage. Verify the wire name for the sourcemap image type and check how unknown image types are handled. Done means events containing a sourcemap image deserialize successfully without dropping the whole event when another image type is unknown.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.