From 726ee090576cf124b79abc327bf128e82404fb94 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Mon, 18 Mar 2024 11:05:50 +0000 Subject: [PATCH 1/3] fix(node): Use unique variable for ANR context transfer --- 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 a8b984b48379..e810a80f2505 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__.acs?.getCurrentScope().getPropagationContext() || {}; ctx.traceId + "-" + ctx.spanId + "-" + ctx.parentSpanId', + 'const __sentry_ctx = __SENTRY__.acs?.getCurrentScope().getPropagationContext() || {}; __sentry_ctx.traceId + "-" + __sentry_ctx.spanId + "-" + __sentry_ctx.parentSpanId', // Don't re-trigger the debugger if this causes an error silent: true, }, From 9e8484002a397f65e84374dc8cda8fa63f4d39ee Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Mon, 18 Mar 2024 13:51:09 +0000 Subject: [PATCH 2/3] Use var --- packages/node-experimental/src/integrations/anr/worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node-experimental/src/integrations/anr/worker.ts b/packages/node-experimental/src/integrations/anr/worker.ts index 5c3cb51f3381..b189f9cdc378 100644 --- a/packages/node-experimental/src/integrations/anr/worker.ts +++ b/packages/node-experimental/src/integrations/anr/worker.ts @@ -172,7 +172,7 @@ if (options.captureStackTrace) { { // Grab the trace context from the current scope expression: - 'const ctx = __SENTRY__.acs?.getCurrentScope().getPropagationContext() || {}; ctx.traceId + "-" + ctx.spanId + "-" + ctx.parentSpanId', + 'var ctx = __SENTRY__.acs?.getCurrentScope().getPropagationContext() || {}; ctx.traceId + "-" + ctx.spanId + "-" + ctx.parentSpanId', // Don't re-trigger the debugger if this causes an error silent: true, }, From f51f777c0ce864fa7ee4c43890296776f59c208b Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Mon, 18 Mar 2024 13:56:50 +0000 Subject: [PATCH 3/3] oops, change the correct package --- packages/node-experimental/src/integrations/anr/worker.ts | 2 +- packages/node/src/integrations/anr/worker.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/node-experimental/src/integrations/anr/worker.ts b/packages/node-experimental/src/integrations/anr/worker.ts index b189f9cdc378..9bcbf9cb7b03 100644 --- a/packages/node-experimental/src/integrations/anr/worker.ts +++ b/packages/node-experimental/src/integrations/anr/worker.ts @@ -172,7 +172,7 @@ if (options.captureStackTrace) { { // Grab the trace context from the current scope expression: - 'var ctx = __SENTRY__.acs?.getCurrentScope().getPropagationContext() || {}; ctx.traceId + "-" + ctx.spanId + "-" + ctx.parentSpanId', + 'var __sentry_ctx = __SENTRY__.acs?.getCurrentScope().getPropagationContext() || {}; __sentry_ctx.traceId + "-" + __sentry_ctx.spanId + "-" + __sentry_ctx.parentSpanId', // Don't re-trigger the debugger if this causes an error silent: true, }, diff --git a/packages/node/src/integrations/anr/worker.ts b/packages/node/src/integrations/anr/worker.ts index e810a80f2505..a8b984b48379 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__.acs?.getCurrentScope().getPropagationContext() || {}; __sentry_ctx.traceId + "-" + __sentry_ctx.spanId + "-" + __sentry_ctx.parentSpanId', + 'const ctx = __SENTRY__.acs?.getCurrentScope().getPropagationContext() || {}; ctx.traceId + "-" + ctx.spanId + "-" + ctx.parentSpanId', // Don't re-trigger the debugger if this causes an error silent: true, },