Skip to content

fix(core): Determine debug ID paths from the top of the stack#7722

Merged
lforst merged 1 commit intodevelopfrom
lforst-reverse-debug-id
Apr 4, 2023
Merged

fix(core): Determine debug ID paths from the top of the stack#7722
lforst merged 1 commit intodevelopfrom
lforst-reverse-debug-id

Conversation

@lforst
Copy link
Copy Markdown
Contributor

@lforst lforst commented Apr 4, 2023

In node (and probably other platforms too), the bottom frame of a trace often contains native code/filenames. See "internal/main/run_main_module.js" below:

[
  {
    "function": "<anonymous>",
    "module": "run_main_module",
    "filename": "internal/main/run_main_module.js",
    "abs_path": "internal/main/run_main_module.js",
    "lineno": 17,
    "colno": 47,
    "in_app": false
  },
  {
    "function": "Function.executeUserEntryPoint [as runMain]",
    "module": "run_main",
    "filename": "internal/modules/run_main.js",
    "abs_path": "internal/modules/run_main.js",
    "lineno": 75,
    "colno": 12,
    "in_app": false
  },
  {
    "function": "Module._load",
    "module": "loader",
    "filename": "internal/modules/cjs/loader.js",
    "abs_path": "internal/modules/cjs/loader.js",
    "lineno": 790,
    "colno": 12,
    "in_app": false
  },
  {
    "function": "Module.load",
    "module": "loader",
    "filename": "internal/modules/cjs/loader.js",
    "abs_path": "internal/modules/cjs/loader.js",
    "lineno": 950,
    "colno": 32,
    "in_app": false
  },
  {
    "function": "Module._extensions..js",
    "module": "loader",
    "filename": "internal/modules/cjs/loader.js",
    "abs_path": "internal/modules/cjs/loader.js",
    "lineno": 1114,
    "colno": 10,
    "in_app": false
  },
  {
    "function": "Module._compile",
    "module": "loader",
    "filename": "internal/modules/cjs/loader.js",
    "abs_path": "internal/modules/cjs/loader.js",
    "lineno": 1085,
    "colno": 14,
    "in_app": false
  },
  {
    "function": "Object.<anonymous>",
    "module": "entrypoint3",
    "filename": "/Users/lucaforstner/code/github/getsentry/sentry-javascript-bundler-plugins/packages/playground/out/rollup/entrypoint3.js",
    "abs_path": "/Users/lucaforstner/code/github/getsentry/sentry-javascript-bundler-plugins/packages/playground/out/rollup/entrypoint3.js",
    "lineno": 58,
    "colno": 36,
    "in_app": true
  }
]

Up until now, for debug ID resolving, we took the first frame that had a filename from the bottom of the stack. When an error occurs, In the lookup logic of the debug IDs we go from the top, meaning that the debug ID will not work when there are native frames/filenames.

This pr fixes this by simply going through the stack frame in reverse.

@lforst lforst requested review from AbhiPrasad and mydea April 4, 2023 09:22
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.72 KB (-0.24% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 64.75 KB (-0.2% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 19.29 KB (+0.03% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 57.23 KB (+0.05% 🔺)
@sentry/browser - Webpack (gzipped + minified) 20.84 KB (+0.03% 🔺)
@sentry/browser - Webpack (minified) 68.2 KB (+0.05% 🔺)
@sentry/react - Webpack (gzipped + minified) 20.87 KB (+0.03% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 48.69 KB (+0.03% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 28.31 KB (-0.16% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 26.54 KB (+0.04% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 44.88 KB (+0.02% 🔺)
@sentry/replay - Webpack (gzipped + minified) 38.86 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 63.59 KB (+0.02% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 56.62 KB (+0.01% 🔺)

@lforst lforst merged commit de75a63 into develop Apr 4, 2023
@lforst lforst deleted the lforst-reverse-debug-id branch April 4, 2023 09:58
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.

2 participants