Skip to content

Commit 3e9ce62

Browse files
authored
fix: Normalise ANR debug image file paths if appRoot was supplied (#14711)
We should normalise all paths in ANR events if an appRoot path is supplied. This is important for the Electron SDK where we normalise around the app path to keep usernames out of reported events.
1 parent e0a1e7a commit 3e9ce62

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/node/src/integrations/anr/worker.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,13 @@ function applyDebugMeta(event: Event): void {
104104

105105
if (filenameToDebugId.size > 0) {
106106
const images: DebugImage[] = [];
107-
for (const [filename, debugId] of filenameToDebugId.entries()) {
107+
for (const [filename, debug_id] of filenameToDebugId.entries()) {
108+
const code_file = options.appRootPath ? normalizeUrlToBase(filename, options.appRootPath) : filename;
109+
108110
images.push({
109111
type: 'sourcemap',
110-
code_file: filename,
111-
debug_id: debugId,
112+
code_file,
113+
debug_id,
112114
});
113115
}
114116
event.debug_meta = { images };

0 commit comments

Comments
 (0)