Skip to content

ref(v8): Remove deprecated methods on scope #11366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions packages/core/src/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down
25 changes: 1 addition & 24 deletions packages/core/test/lib/scope.test.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions packages/types/src/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down