From c0ca43d7fd84f8fad3064c51145d70dd0be44bfe Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Mon, 30 Dec 2024 16:39:08 +0100 Subject: [PATCH] fix ANR session handling --- packages/node/src/integrations/anr/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/node/src/integrations/anr/index.ts b/packages/node/src/integrations/anr/index.ts index aa903789ad12..7b25d851137a 100644 --- a/packages/node/src/integrations/anr/index.ts +++ b/packages/node/src/integrations/anr/index.ts @@ -186,7 +186,7 @@ async function _startWorker( const timer = setInterval(() => { try { - const currentSession = getCurrentScope().getSession(); + const currentSession = getIsolationScope().getSession(); // We need to copy the session object and remove the toJSON method so it can be sent to the worker // serialized without making it a SerializedSession const session = currentSession ? { ...currentSession, toJSON: undefined } : undefined; @@ -202,7 +202,7 @@ async function _startWorker( worker.on('message', (msg: string) => { if (msg === 'session-ended') { log('ANR event sent from ANR worker. Clearing session in this thread.'); - getCurrentScope().setSession(undefined); + getIsolationScope().setSession(undefined); } });