From c1cabb86803fbf9b158a9f32758cfe558cba3b63 Mon Sep 17 00:00:00 2001 From: Sebastian Zivota Date: Tue, 26 Nov 2024 12:06:42 +0100 Subject: [PATCH 1/3] fix(js): Prefer debug_id --- symbolic-debuginfo/src/js.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/symbolic-debuginfo/src/js.rs b/symbolic-debuginfo/src/js.rs index 5da34c8e..c637b18f 100644 --- a/symbolic-debuginfo/src/js.rs +++ b/symbolic-debuginfo/src/js.rs @@ -31,10 +31,10 @@ pub fn discover_sourcemaps_location(contents: &str) -> Option<&str> { /// Quickly reads the embedded `debug_id` key from a source map. /// /// Both `debugId` and `debug_id` are supported as field names. If both -/// are set, the former takes precedence. +/// are set, the latter takes precedence. pub fn discover_sourcemap_embedded_debug_id(contents: &str) -> Option { // Deserialize from `"debugId"` or `"debug_id"`, - // preferring the former. + // preferring the latter. #[derive(Deserialize)] struct DebugIdInSourceMap { #[serde(rename = "debugId")] @@ -45,7 +45,7 @@ pub fn discover_sourcemap_embedded_debug_id(contents: &str) -> Option { serde_json::from_str(contents) .ok() - .and_then(|x: DebugIdInSourceMap| x.debug_id_new.or(x.debug_id_old)) + .and_then(|x: DebugIdInSourceMap| x.debug_id_old.or(x.debug_id_new)) } /// Parses a `debugId` comment in a file to discover a sourcemap's debug ID. From 92f7a06f888385a46a6fc754504fc3c0d26e6314 Mon Sep 17 00:00:00 2001 From: Sebastian Zivota Date: Tue, 26 Nov 2024 12:11:18 +0100 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58ad529a..45b4a0c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Unreleased + +**Fixes** +- js: Prefer `"debug_id"` for sourcemap debug IDs. ([#878](https://github.com/getsentry/symbolic/pull/878)). + ## 12.12.2 **Fixes** From 052ada7de028aeff6806c0d07ced076a95700122 Mon Sep 17 00:00:00 2001 From: Sebastian Zivota Date: Tue, 26 Nov 2024 12:13:23 +0100 Subject: [PATCH 3/3] Fix test --- symbolic-debuginfo/src/js.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symbolic-debuginfo/src/js.rs b/symbolic-debuginfo/src/js.rs index c637b18f..bf3341fe 100644 --- a/symbolic-debuginfo/src/js.rs +++ b/symbolic-debuginfo/src/js.rs @@ -103,8 +103,8 @@ mod tests { "sources":["coolstuff.js"], "names":["x","alert"], "mappings":"AAAA,GAAIA,GAAI,EACR,IAAIA,GAAK,EAAG,CACVC,MAAM", - "debugId":"00000000-0000-0000-0000-000000000000", - "debug_id":"11111111-1111-1111-1111-111111111111" + "debug_id":"00000000-0000-0000-0000-000000000000", + "debugId":"11111111-1111-1111-1111-111111111111" }"#; assert_eq!(