From 6896c2d875ef0a1acb2b91b83342e04d37f1f0d8 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Wed, 13 Dec 2023 17:12:00 +0100 Subject: [PATCH] Revert scope changes --- src/main/integrations/electron-minidump.ts | 3 ++- src/main/integrations/sentry-minidump/index.ts | 10 +++++----- src/main/ipc.ts | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/integrations/electron-minidump.ts b/src/main/integrations/electron-minidump.ts index a7e48bbc..afdaa54f 100644 --- a/src/main/integrations/electron-minidump.ts +++ b/src/main/integrations/electron-minidump.ts @@ -145,7 +145,8 @@ export class ElectronMinidump implements Integration { const hubScope = getCurrentHub().getScope(); if (hubScope) { hubScope.addScopeListener((updatedScope) => { - const scope = updatedScope.clone() as any; + // eslint-disable-next-line deprecation/deprecation + const scope = Scope.clone(updatedScope); /* eslint-disable @typescript-eslint/no-unsafe-member-access */ (scope as any)._eventProcessors = []; (scope as any)._scopeListeners = []; diff --git a/src/main/integrations/sentry-minidump/index.ts b/src/main/integrations/sentry-minidump/index.ts index 8894d03b..0f9f5ce4 100644 --- a/src/main/integrations/sentry-minidump/index.ts +++ b/src/main/integrations/sentry-minidump/index.ts @@ -187,7 +187,8 @@ export class SentryMinidump implements Integration { */ private _setupScopeListener(currentRelease: string, currentEnvironment: string): void { const scopeChanged = (updatedScope: Scope): void => { - const scope = updatedScope.clone(); + // eslint-disable-next-line deprecation/deprecation + const scope = Scope.clone(updatedScope); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access (scope as any)._eventProcessors = []; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access @@ -248,10 +249,9 @@ export class SentryMinidump implements Integration { if (event.tags?.['event.process'] === 'browser') { const previousRun = await this._scopeLastRun; - const storedScope = previousRun?.scope?.clone(); - if (storedScope) { - event = await storedScope.applyToEvent(event); - } + // eslint-disable-next-line deprecation/deprecation + const storedScope = Scope.clone(previousRun?.scope); + event = await storedScope.applyToEvent(event); if (event && previousRun) { event.release = previousRun.event?.release || event.release; diff --git a/src/main/ipc.ts b/src/main/ipc.ts index a2f55869..d35e7bcb 100644 --- a/src/main/ipc.ts +++ b/src/main/ipc.ts @@ -141,7 +141,8 @@ function handleScope(options: ElectronMainOptionsInternal, jsonScope: string): v return; } - const sentScope = rendererScope.clone() as any; + // eslint-disable-next-line deprecation/deprecation + const sentScope = Scope.clone(rendererScope) as any; /* eslint-disable @typescript-eslint/no-unsafe-member-access */ configureScope((scope) => { if (hasKeys(sentScope._user)) {