Skip to content

Commit

Permalink
Revert scope changes
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish committed Dec 13, 2023
1 parent 75ac368 commit 6896c2d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/main/integrations/electron-minidump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
10 changes: 5 additions & 5 deletions src/main/integrations/sentry-minidump/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/main/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 6896c2d

Please sign in to comment.