From 29c4ad21589a908751f4bb7d6adcf2a71cb20e81 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 2 Apr 2024 13:03:47 +0200 Subject: [PATCH 1/3] ref(v8): Remove deprecated methods on scope --- packages/core/src/scope.ts | 18 ------------------ packages/types/src/scope.ts | 5 ----- 2 files changed, 23 deletions(-) diff --git a/packages/core/src/scope.ts b/packages/core/src/scope.ts index a86bbfafcc8f..d75cd521cf9f 100644 --- a/packages/core/src/scope.ts +++ b/packages/core/src/scope.ts @@ -112,14 +112,6 @@ export class Scope implements ScopeInterface { this._propagationContext = generatePropagationContext(); } - /** - * Inherit values from the parent scope. - * @deprecated Use `scope.clone()` and `new Scope()` instead. - */ - public static clone(scope?: Scope): Scope { - return scope ? scope.clone() : new Scope(); - } - /** * @inheritDoc */ @@ -469,16 +461,6 @@ export class Scope implements ScopeInterface { return this; } - /** - * @inheritDoc - * @deprecated Use `getScopeData()` instead. - */ - public getAttachments(): Attachment[] { - const data = this.getScopeData(); - - return data.attachments; - } - /** * @inheritDoc */ diff --git a/packages/types/src/scope.ts b/packages/types/src/scope.ts index 641a77dd080c..b3b43b95439e 100644 --- a/packages/types/src/scope.ts +++ b/packages/types/src/scope.ts @@ -206,11 +206,6 @@ export interface Scope { */ addAttachment(attachment: Attachment): this; - /** - * Returns an array of attachments on the scope - */ - getAttachments(): Attachment[]; - /** * Clears attachments from the scope */ From 0d202df79b2d3618b71fc5b063a3f937be539b57 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 2 Apr 2024 13:20:34 +0200 Subject: [PATCH 2/3] fix test --- packages/core/test/lib/scope.test.ts | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/packages/core/test/lib/scope.test.ts b/packages/core/test/lib/scope.test.ts index 267053e6a9b0..b9ac143bf348 100644 --- a/packages/core/test/lib/scope.test.ts +++ b/packages/core/test/lib/scope.test.ts @@ -543,29 +543,6 @@ describe('Scope', () => { }); }); - describe('getAttachments', () => { - /* eslint-disable deprecation/deprecation */ - it('works without any data', async () => { - const scope = new Scope(); - - const actual = scope.getAttachments(); - expect(actual).toEqual([]); - }); - - it('works with attachments', async () => { - const attachment1 = { filename: '1' } as Attachment; - const attachment2 = { filename: '2' } as Attachment; - - const scope = new Scope(); - scope.addAttachment(attachment1); - scope.addAttachment(attachment2); - - const actual = scope.getAttachments(); - expect(actual).toEqual([attachment1, attachment2]); - }); - /* eslint-enable deprecation/deprecation */ - }); - describe('setClient() and getClient()', () => { it('allows storing and retrieving client objects', () => { const fakeClient = {} as Client; From 35a67d8d7e125ad59828340dcecf578b05218691 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 2 Apr 2024 14:01:13 +0200 Subject: [PATCH 3/3] fix linting --- packages/core/test/lib/scope.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/test/lib/scope.test.ts b/packages/core/test/lib/scope.test.ts index b9ac143bf348..bbd40af742d1 100644 --- a/packages/core/test/lib/scope.test.ts +++ b/packages/core/test/lib/scope.test.ts @@ -1,4 +1,4 @@ -import type { Attachment, Breadcrumb, Client, Event, RequestSessionStatus } from '@sentry/types'; +import type { Breadcrumb, Client, Event, RequestSessionStatus } from '@sentry/types'; import { applyScopeDataToEvent, getCurrentScope,