Skip to content

Commit

Permalink
fix ANR session handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Dec 30, 2024
1 parent 257dd8e commit c0ca43d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/node/src/integrations/anr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
});

Expand Down

0 comments on commit c0ca43d

Please sign in to comment.