Skip to content

Commit c0ca43d

Browse files
committed
fix ANR session handling
1 parent 257dd8e commit c0ca43d

File tree

1 file changed

+2
-2
lines changed
  • packages/node/src/integrations/anr

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ async function _startWorker(
186186

187187
const timer = setInterval(() => {
188188
try {
189-
const currentSession = getCurrentScope().getSession();
189+
const currentSession = getIsolationScope().getSession();
190190
// We need to copy the session object and remove the toJSON method so it can be sent to the worker
191191
// serialized without making it a SerializedSession
192192
const session = currentSession ? { ...currentSession, toJSON: undefined } : undefined;
@@ -202,7 +202,7 @@ async function _startWorker(
202202
worker.on('message', (msg: string) => {
203203
if (msg === 'session-ended') {
204204
log('ANR event sent from ANR worker. Clearing session in this thread.');
205-
getCurrentScope().setSession(undefined);
205+
getIsolationScope().setSession(undefined);
206206
}
207207
});
208208

0 commit comments

Comments
 (0)