8000 fx(node): Fix anr worker check (#10719) · GingerAdonis/sentry-javascript@e4dc5a7 · GitHub
[go: up one dir, main page]

Skip to content

Commit e4dc5a7

Browse files
authored
fx(node): Fix anr worker check (getsentry#10719)
I've removed the `hub` global on the carrier in a recent PR, and noticed this leftover. Guess this is not used/covered by tests...? It should work with using `acs` as that should now always be set too (also for the default case), unless sentry is not initialized. But for type safety, the acs _may_ be undefined.
1 parent 4f92ff0 commit e4dc5a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ if (options.captureStackTrace) {
173173
{
174174
// Grab the trace context from the current scope
175175
expression:
176-
'const ctx = __SENTRY__.hub.getScope().getPropagationContext(); ctx.traceId + "-" + ctx.spanId + "-" + ctx.parentSpanId',
176+
'const ctx = __SENTRY__.acs?.getCurrentScope().getPropagationContext() || {}; ctx.traceId + "-" + ctx.spanId + "-" + ctx.parentSpanId',
177177
// Don't re-trigger the debugger if this causes an error
178178
silent: true,
179179
},

0 commit comments

Comments
 (0)
0