From 3b3f5d1314aa6a2f3f8d9cb57344cbedb109149f Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Mon, 18 Mar 2024 11:09:22 +0000 Subject: [PATCH 1/2] fix(node): Use unique variable for ANR context transfer (v7) --- packages/node/src/integrations/anr/worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node/src/integrations/anr/worker.ts b/packages/node/src/integrations/anr/worker.ts index 2e23f823891c..9b2af2adeaad 100644 --- a/packages/node/src/integrations/anr/worker.ts +++ b/packages/node/src/integrations/anr/worker.ts @@ -173,7 +173,7 @@ if (options.captureStackTrace) { { // Grab the trace context from the current scope expression: - 'const ctx = __SENTRY__.hub.getScope().getPropagationContext(); ctx.traceId + "-" + ctx.spanId + "-" + ctx.parentSpanId', + 'const __sentry_ctx = __SENTRY__.hub.getScope().getPropagationContext(); __sentry_ctx.traceId + "-" + __sentry_ctx.spanId + "-" + __sentry_ctx.parentSpanId', // Don't re-trigger the debugger if this causes an error silent: true, }, From ccb0ebeafcb6664fb615eef040153ae0fa72b2da Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Mon, 18 Mar 2024 13:51:42 +0000 Subject: [PATCH 2/2] Use var --- packages/node/src/integrations/anr/worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node/src/integrations/anr/worker.ts b/packages/node/src/integrations/anr/worker.ts index 9b2af2adeaad..cff2c4c515ec 100644 --- a/packages/node/src/integrations/anr/worker.ts +++ b/packages/node/src/integrations/anr/worker.ts @@ -173,7 +173,7 @@ if (options.captureStackTrace) { { // Grab the trace context from the current scope expression: - 'const __sentry_ctx = __SENTRY__.hub.getScope().getPropagationContext(); __sentry_ctx.traceId + "-" + __sentry_ctx.spanId + "-" + __sentry_ctx.parentSpanId', + 'var __sentry_ctx = __SENTRY__.hub.getScope().getPropagationContext(); __sentry_ctx.traceId + "-" + __sentry_ctx.spanId + "-" + __sentry_ctx.parentSpanId', // Don't re-trigger the debugger if this causes an error silent: true, },