-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(node): Include debug_meta
with ANR events
#14203
Conversation
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky tests
To view more test analytics, go to the Test Analytics Dashboard |
let debugImages: Record<string, string> = getFilenameToDebugIdMap(initOptions.stackParser); | ||
|
||
onModuleLoad(() => { | ||
debugImages = getFilenameToDebugIdMap(initOptions.stackParser); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this potentially called every require
/import
? That means we re-calculate this every time. That feels like a lot of work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could debounce the require
/import
but any delay sending the debug ids to the worker could result in missing debug ids.
If global._sentryDebugIds
is undefined, getFilenameToDebugIdMap
returns immediately so this only impacts those with injected debug id polyfills. getFilenameToDebugIdMap
already caches a lot. If there have been no additions to global._sentryDebugIds
, no stack parsing occurs. There is still scope for it to cache more though and simplify the work done on each call. That would probably be a good start 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright let's proceed for now, we should re-visit this though.
// eslint-disable-next-line deprecation/deprecation | ||
diagnosticsChannel.channel('module.require.end').subscribe(() => callback()); | ||
// eslint-disable-next-line deprecation/deprecation | ||
diagnosticsChannel.channel('module.import.asyncEnd').subscribe(() => callback()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a new API in diagnostics_channel
to subscribe to a channel but we need to support older Node versions where this doesn't exist so we rely on the deprecated API.
Sends a map of filename -> debug ids to the ANR worker thread and sends an updated list every time more modules are loaded. These are then used and included with events so they can be symbolicated