diff --git a/packages/core/src/scope.ts b/packages/core/src/scope.ts index 7919e67e2b18..9931f8d94279 100644 --- a/packages/core/src/scope.ts +++ b/packages/core/src/scope.ts @@ -456,6 +456,7 @@ export class Scope implements ScopeInterface { /** * @inheritDoc + * @deprecated Use `getScopeData()` instead. */ public getAttachments(): Attachment[] { const data = this.getScopeData(); @@ -472,7 +473,7 @@ export class Scope implements ScopeInterface { } /** @inheritDoc */ - public getPerScopeData(): ScopeData { + public getScopeData(): ScopeData { const { _breadcrumbs, _attachments, @@ -506,16 +507,6 @@ export class Scope implements ScopeInterface { }; } - /** @inheritdoc */ - public getScopeData(): ScopeData { - const data = getGlobalScope().getPerScopeData(); - const scopeData = this.getPerScopeData(); - - mergeScopeData(data, scopeData); - - return data; - } - /** * Applies data from the scope to the event and runs all event processors on it. * diff --git a/packages/core/src/utils/prepareEvent.ts b/packages/core/src/utils/prepareEvent.ts index 76307b4f45e6..a4584c34066a 100644 --- a/packages/core/src/utils/prepareEvent.ts +++ b/packages/core/src/utils/prepareEvent.ts @@ -13,8 +13,8 @@ import { GLOBAL_OBJ, addExceptionMechanism, dateTimestampInSeconds, normalize, t import { DEFAULT_ENVIRONMENT } from '../constants'; import { getGlobalEventProcessors, notifyEventProcessors } from '../eventProcessors'; -import { Scope } from '../scope'; -import { applyScopeDataToEvent } from './applyScopeDataToEvent'; +import { Scope, getGlobalScope } from '../scope'; +import { applyScopeDataToEvent, mergeScopeData } from './applyScopeDataToEvent'; /** * This type makes sure that we get either a CaptureContext, OR an EventHint. @@ -74,36 +74,32 @@ export function prepareEvent( } const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : []; - // TODO (v8): Update this order to be: Global > Client > Scope - const eventProcessors = [ - ...clientEventProcessors, - // eslint-disable-next-line deprecation/deprecation - ...getGlobalEventProcessors(), - ]; // This should be the last thing called, since we want that // {@link Hub.addEventProcessor} gets the finished prepared event. - // - // We need to check for the existence of `finalScope.getAttachments` - // because `getAttachments` can be undefined if users are using an older version - // of `@sentry/core` that does not have the `getAttachments` method. - // See: https://github.com/getsentry/sentry-javascript/issues/5229 + // Merge scope data together + const data = getGlobalScope().getScopeData(); + if (finalScope) { - // Collect attachments from the hint and scope - if (finalScope.getAttachments) { - const attachments = [...(hint.attachments || []), ...finalScope.getAttachments()]; + const finalScopeData = finalScope.getScopeData(); + mergeScopeData(data, finalScopeData); + } - if (attachments.length) { - hint.attachments = attachments; - } - } + const attachments = [...(hint.attachments || []), ...data.attachments]; + if (attachments.length) { + hint.attachments = attachments; + } - const scopeData = finalScope.getScopeData(); - applyScopeDataToEvent(prepared, scopeData); + applyScopeDataToEvent(prepared, data); + // TODO (v8): Update this order to be: Global > Client > Scope + const eventProcessors = [ + ...clientEventProcessors, + // eslint-disable-next-line deprecation/deprecation + ...getGlobalEventProcessors(), // Run scope event processors _after_ all other processors - eventProcessors.push(...scopeData.eventProcessors); - } + ...data.eventProcessors, + ]; const result = notifyEventProcessors(eventProcessors, prepared, hint); diff --git a/packages/core/test/lib/base.test.ts b/packages/core/test/lib/base.test.ts index baeb8bfd0044..9ba1d60efeab 100644 --- a/packages/core/test/lib/base.test.ts +++ b/packages/core/test/lib/base.test.ts @@ -1,7 +1,7 @@ import type { Client, Envelope, Event, Span, Transaction } from '@sentry/types'; import { SentryError, SyncPromise, dsnToString, logger } from '@sentry/utils'; -import { Hub, Scope, makeSession } from '../../src'; +import { Hub, Scope, clearGlobalData, makeSession } from '../../src'; import * as integrationModule from '../../src/integration'; import { TestClient, getDefaultTestClientOptions } from '../mocks/client'; import { AdHocIntegration, TestIntegration } from '../mocks/integration'; @@ -54,6 +54,7 @@ describe('BaseClient', () => { beforeEach(() => { TestClient.sendEventCalled = undefined; TestClient.instance = undefined; + clearGlobalData(); }); afterEach(() => { @@ -756,7 +757,8 @@ describe('BaseClient', () => { expect(TestClient.instance!.event!).toEqual( expect.objectContaining({ breadcrumbs: [normalizedBreadcrumb, normalizedBreadcrumb, normalizedBreadcrumb], - contexts: normalizedObject, + // also has trace context from global scope + contexts: { ...normalizedObject, trace: expect.anything() }, environment: 'production', event_id: '42', extra: normalizedObject, @@ -805,7 +807,8 @@ describe('BaseClient', () => { expect(TestClient.instance!.event!).toEqual( expect.objectContaining({ breadcrumbs: [normalizedBreadcrumb, normalizedBreadcrumb, normalizedBreadcrumb], - contexts: normalizedObject, + // also has trace context from global scope + contexts: { ...normalizedObject, trace: expect.anything() }, environment: 'production', event_id: '42', extra: normalizedObject, @@ -859,7 +862,8 @@ describe('BaseClient', () => { expect(TestClient.instance!.event!).toEqual( expect.objectContaining({ breadcrumbs: [normalizedBreadcrumb, normalizedBreadcrumb, normalizedBreadcrumb], - contexts: normalizedObject, + // also has trace context from global scope + contexts: { ...normalizedObject, trace: expect.anything() }, environment: 'production', event_id: '42', extra: normalizedObject, diff --git a/packages/core/test/lib/prepareEvent.test.ts b/packages/core/test/lib/prepareEvent.test.ts index b98305dea604..9e2f69e0f654 100644 --- a/packages/core/test/lib/prepareEvent.test.ts +++ b/packages/core/test/lib/prepareEvent.test.ts @@ -1,8 +1,23 @@ -import type { Event, EventHint, ScopeContext } from '@sentry/types'; +import type { + Attachment, + Breadcrumb, + Client, + ClientOptions, + Event, + EventHint, + EventProcessor, + ScopeContext, +} from '@sentry/types'; import { GLOBAL_OBJ, createStackParser } from '@sentry/utils'; +import { clearGlobalData } from '../../src'; -import { Scope } from '../../src/scope'; -import { applyDebugIds, applyDebugMeta, parseEventHintOrCaptureContext } from '../../src/utils/prepareEvent'; +import { Scope, getGlobalScope } from '../../src/scope'; +import { + applyDebugIds, + applyDebugMeta, + parseEventHintOrCaptureContext, + prepareEvent, +} from '../../src/utils/prepareEvent'; describe('applyDebugIds', () => { afterEach(() => { @@ -173,3 +188,170 @@ describe('parseEventHintOrCaptureContext', () => { }); }); }); + +describe('prepareEvent', () => { + beforeEach(() => { + clearGlobalData(); + }); + + it('works without any scope data', async () => { + const eventProcessor = jest.fn((a: unknown) => a) as EventProcessor; + + const scope = new Scope(); + + const event = { message: 'foo' }; + + const options = {} as ClientOptions; + const client = { + getEventProcessors() { + return [eventProcessor]; + }, + } as Client; + const processedEvent = await prepareEvent( + options, + event, + { + integrations: [], + }, + scope, + client, + ); + + expect(eventProcessor).toHaveBeenCalledWith(processedEvent, { + integrations: [], + // no attachments are added to hint + }); + + expect(processedEvent).toEqual({ + timestamp: expect.any(Number), + event_id: expect.any(String), + environment: 'production', + message: 'foo', + sdkProcessingMetadata: { + propagationContext: { + spanId: expect.any(String), + traceId: expect.any(String), + }, + }, + }); + }); + + it('merges scope data', async () => { + const breadcrumb1 = { message: '1', timestamp: 111 } as Breadcrumb; + const breadcrumb2 = { message: '2', timestamp: 222 } as Breadcrumb; + const breadcrumb3 = { message: '3', timestamp: 123 } as Breadcrumb; + + const eventProcessor1 = jest.fn((a: unknown) => a) as EventProcessor; + const eventProcessor2 = jest.fn((b: unknown) => b) as EventProcessor; + + const attachment1 = { filename: '1' } as Attachment; + const attachment2 = { filename: '2' } as Attachment; + + const scope = new Scope(); + scope.update({ + user: { id: '1', email: 'test@example.com' }, + tags: { tag1: 'aa', tag2: 'aa' }, + extra: { extra1: 'aa', extra2: 'aa' }, + contexts: { os: { name: 'os1' }, culture: { display_name: 'name1' } }, + propagationContext: { spanId: '1', traceId: '1' }, + fingerprint: ['aa'], + }); + scope.addBreadcrumb(breadcrumb1); + scope.addEventProcessor(eventProcessor1); + scope.addAttachment(attachment1); + + const globalScope = getGlobalScope(); + + globalScope.addBreadcrumb(breadcrumb2); + globalScope.addEventProcessor(eventProcessor2); + globalScope.setSDKProcessingMetadata({ aa: 'aa' }); + globalScope.addAttachment(attachment2); + + const event = { message: 'foo', breadcrumbs: [breadcrumb3], fingerprint: ['dd'] }; + + const options = {} as ClientOptions; + const processedEvent = await prepareEvent( + options, + event, + { + integrations: [], + }, + scope, + ); + + expect(eventProcessor1).toHaveBeenCalledTimes(1); + expect(eventProcessor2).toHaveBeenCalledTimes(1); + + // Test that attachments are correctly merged + expect(eventProcessor1).toHaveBeenCalledWith(processedEvent, { + integrations: [], + attachments: [attachment2, attachment1], + }); + + expect(processedEvent).toEqual({ + timestamp: expect.any(Number), + event_id: expect.any(String), + environment: 'production', + message: 'foo', + user: { id: '1', email: 'test@example.com' }, + tags: { tag1: 'aa', tag2: 'aa' }, + extra: { extra1: 'aa', extra2: 'aa' }, + contexts: { os: { name: 'os1' }, culture: { display_name: 'name1' } }, + fingerprint: ['dd', 'aa'], + breadcrumbs: [breadcrumb3, breadcrumb2, breadcrumb1], + sdkProcessingMetadata: { + aa: 'aa', + propagationContext: { + spanId: '1', + traceId: '1', + }, + }, + }); + }); + + it('works without a scope', async () => { + const breadcrumb1 = { message: '1', timestamp: 111 } as Breadcrumb; + const breadcrumb2 = { message: '2', timestamp: 222 } as Breadcrumb; + + const eventProcessor1 = jest.fn((a: unknown) => a) as EventProcessor; + + const attachment1 = { filename: '1' } as Attachment; + const attachment2 = { filename: '2' } as Attachment; + + const globalScope = getGlobalScope(); + + globalScope.addBreadcrumb(breadcrumb1); + globalScope.addEventProcessor(eventProcessor1); + globalScope.setSDKProcessingMetadata({ aa: 'aa' }); + globalScope.addAttachment(attachment1); + + const event = { message: 'foo', breadcrumbs: [breadcrumb2], fingerprint: ['dd'] }; + + const options = {} as ClientOptions; + const processedEvent = await prepareEvent(options, event, { + integrations: [], + attachments: [attachment2], + }); + + expect(eventProcessor1).toHaveBeenCalledTimes(1); + + // Test that attachments are correctly merged + expect(eventProcessor1).toHaveBeenCalledWith(processedEvent, { + integrations: [], + attachments: [attachment2, attachment1], + }); + + expect(processedEvent).toEqual({ + timestamp: expect.any(Number), + event_id: expect.any(String), + environment: 'production', + message: 'foo', + fingerprint: ['dd'], + breadcrumbs: [breadcrumb2, breadcrumb1], + sdkProcessingMetadata: { + aa: 'aa', + propagationContext: globalScope.getPropagationContext(), + }, + }); + }); +}); diff --git a/packages/core/test/lib/scope.test.ts b/packages/core/test/lib/scope.test.ts index 860e6caf7980..3bcdbf4022ce 100644 --- a/packages/core/test/lib/scope.test.ts +++ b/packages/core/test/lib/scope.test.ts @@ -127,13 +127,9 @@ describe('Unit | Scope', () => { }); }); - it('merges scope data', async () => { + it('works with data', async () => { const breadcrumb1 = { message: '1', timestamp: 111 } as Breadcrumb; - const breadcrumb2 = { message: '2', timestamp: 222 } as Breadcrumb; - const breadcrumb3 = { message: '4', timestamp: 333 } as Breadcrumb; - - const eventProcessor1 = jest.fn((a: unknown) => a) as EventProcessor; - const eventProcessor2 = jest.fn((b: unknown) => b) as EventProcessor; + const breadcrumb2 = { message: '1', timestamp: 111 } as Breadcrumb; const scope = new Scope(); scope.update({ @@ -145,16 +141,9 @@ describe('Unit | Scope', () => { fingerprint: ['aa'], }); scope.addBreadcrumb(breadcrumb1); - scope.addEventProcessor(eventProcessor1); scope.setSDKProcessingMetadata({ aa: 'aa' }); - const globalScope = getGlobalScope(); - - globalScope.addBreadcrumb(breadcrumb2); - globalScope.addEventProcessor(eventProcessor2); - globalScope.setSDKProcessingMetadata({ bb: 'bb' }); - - const event = { message: 'foo', breadcrumbs: [breadcrumb3], fingerprint: ['dd'] }; + const event = { message: 'foo', breadcrumbs: [breadcrumb2], fingerprint: ['dd'] }; applyScopeDataToEvent(event, scope.getScopeData()); @@ -165,10 +154,9 @@ describe('Unit | Scope', () => { extra: { extra1: 'aa', extra2: 'aa' }, contexts: { os: { name: 'os1' }, culture: { display_name: 'name1' } }, fingerprint: ['dd', 'aa'], - breadcrumbs: [breadcrumb3, breadcrumb2, breadcrumb1], + breadcrumbs: [breadcrumb2, breadcrumb1], sdkProcessingMetadata: { aa: 'aa', - bb: 'bb', propagationContext: { spanId: '1', traceId: '1', @@ -179,6 +167,7 @@ describe('Unit | Scope', () => { }); describe('getAttachments', () => { + /* eslint-disable deprecation/deprecation */ it('works without any data', async () => { const scope = new Scope(); @@ -186,19 +175,17 @@ describe('Unit | Scope', () => { expect(actual).toEqual([]); }); - it('merges attachments data', async () => { + it('works with attachments', async () => { const attachment1 = { filename: '1' } as Attachment; const attachment2 = { filename: '2' } as Attachment; const scope = new Scope(); scope.addAttachment(attachment1); - - const globalScope = getGlobalScope(); - - globalScope.addAttachment(attachment2); + scope.addAttachment(attachment2); const actual = scope.getAttachments(); - expect(actual).toEqual([attachment2, attachment1]); + expect(actual).toEqual([attachment1, attachment2]); }); + /* eslint-enable deprecation/deprecation */ }); }); diff --git a/packages/node-experimental/src/sdk/scope.ts b/packages/node-experimental/src/sdk/scope.ts index cb1247ed5b31..72b558c02e1f 100644 --- a/packages/node-experimental/src/sdk/scope.ts +++ b/packages/node-experimental/src/sdk/scope.ts @@ -187,14 +187,27 @@ export class Scope extends OpenTelemetryScope implements ScopeInterface { return this._addBreadcrumb(breadcrumb, maxBreadcrumbs); } + /** Get scope data for this scope only. */ + public getOwnScopeData(): ScopeData { + return super.getScopeData(); + } + /** @inheritdoc */ public getScopeData(): ScopeData { - const data = getGlobalScope().getPerScopeData(); - const isolationScopeData = this._getIsolationScope().getPerScopeData(); - const scopeData = this.getPerScopeData(); + const globalScope = getGlobalScope(); + const isolationScope = this._getIsolationScope(); + + // Special case: If this is the global/isolation scope, no need to merge other data in here + if (this === globalScope || this === isolationScope) { + return this.getOwnScopeData(); + } + + // Global scope is applied anyhow in prepareEvent, + // but we need to merge the isolation scope in here + const data = isolationScope.getOwnScopeData(); + const scopeData = this.getOwnScopeData(); // Merge data together, in order - mergeScopeData(data, isolationScopeData); mergeScopeData(data, scopeData); return data; diff --git a/packages/node-experimental/test/integration/scope.test.ts b/packages/node-experimental/test/integration/scope.test.ts index d5f1d3156a11..9604aa3c1ac3 100644 --- a/packages/node-experimental/test/integration/scope.test.ts +++ b/packages/node-experimental/test/integration/scope.test.ts @@ -246,14 +246,14 @@ describe('Integration | Scope', () => { globalScope.setTag('tag1', 'val1'); globalScope.setTag('tag2', 'val2'); - expect(globalScope.getPerScopeData().tags).toEqual({ tag1: 'val1', tag2: 'val2' }); + expect(globalScope.getScopeData().tags).toEqual({ tag1: 'val1', tag2: 'val2' }); // Now when we call init, the global scope remains intact Sentry.init({ dsn: 'https://username@domain/123', defaultIntegrations: false }); expect(globalScope.getClient()).toBeDefined(); expect(Sentry.getGlobalScope()).toBe(globalScope); - expect(globalScope.getPerScopeData().tags).toEqual({ tag1: 'val1', tag2: 'val2' }); + expect(globalScope.getScopeData().tags).toEqual({ tag1: 'val1', tag2: 'val2' }); }); it('is applied to events', async () => { @@ -304,7 +304,7 @@ describe('Integration | Scope', () => { isolationScope.setTag('tag1', 'val1'); isolationScope.setTag('tag2', 'val2'); - expect(isolationScope.getPerScopeData().tags).toEqual({ tag1: 'val1', tag2: 'val2' }); + expect(isolationScope.getScopeData().tags).toEqual({ tag1: 'val1', tag2: 'val2' }); // Now when we call init, the isolation scope remains intact Sentry.init({ dsn: 'https://username@domain/123', defaultIntegrations: false }); @@ -312,7 +312,7 @@ describe('Integration | Scope', () => { // client is only attached to global scope by default expect(isolationScope.getClient()).toBeUndefined(); expect(Sentry.getIsolationScope()).toBe(isolationScope); - expect(isolationScope.getPerScopeData().tags).toEqual({ tag1: 'val1', tag2: 'val2' }); + expect(isolationScope.getScopeData().tags).toEqual({ tag1: 'val1', tag2: 'val2' }); }); it('is applied to events', async () => { @@ -368,13 +368,13 @@ describe('Integration | Scope', () => { expect(newIsolationScope).not.toBe(initialIsolationScope); // Data is forked off original isolation scope - expect(newIsolationScope.getPerScopeData().tags).toEqual({ tag1: 'val1', tag2: 'val2' }); + expect(newIsolationScope.getScopeData().tags).toEqual({ tag1: 'val1', tag2: 'val2' }); newIsolationScope.setTag('tag3', 'val3'); Sentry.captureException(error); }); - expect(initialIsolationScope.getPerScopeData().tags).toEqual({ tag1: 'val1', tag2: 'val2' }); + expect(initialIsolationScope.getScopeData().tags).toEqual({ tag1: 'val1', tag2: 'val2' }); await client.flush(); diff --git a/packages/node-experimental/test/sdk/scope.test.ts b/packages/node-experimental/test/sdk/scope.test.ts index d1cc12b7463b..c38437121959 100644 --- a/packages/node-experimental/test/sdk/scope.test.ts +++ b/packages/node-experimental/test/sdk/scope.test.ts @@ -1,5 +1,5 @@ -import { applyScopeDataToEvent } from '@sentry/core'; -import type { Attachment, Breadcrumb, Client, EventProcessor } from '@sentry/types'; +import { prepareEvent } from '@sentry/core'; +import type { Attachment, Breadcrumb, Client, ClientOptions, EventProcessor } from '@sentry/types'; import { Scope, getIsolationScope } from '../../src'; import { getGlobalScope } from '../../src/sdk/scope'; import { mockSdkInit, resetGlobals } from '../helpers/mockSdkInit'; @@ -108,16 +108,41 @@ describe('Unit | Scope', () => { expect(scope['_getIsolationScope']()).toBe(customIsolationScope); }); - describe('applyToEvent', () => { - it('works without any data', async () => { + describe('prepareEvent', () => { + it('works without any scope data', async () => { mockSdkInit(); + const eventProcessor = jest.fn((a: unknown) => a) as EventProcessor; + const scope = new Scope(); const event = { message: 'foo' }; - applyScopeDataToEvent(event, scope.getScopeData()); - expect(event).toEqual({ + const options = {} as ClientOptions; + const client = { + getEventProcessors() { + return [eventProcessor]; + }, + } as Client; + const processedEvent = await prepareEvent( + options, + event, + { + integrations: [], + }, + scope, + client, + ); + + expect(eventProcessor).toHaveBeenCalledWith(processedEvent, { + integrations: [], + // no attachments are added to hint + }); + + expect(processedEvent).toEqual({ + timestamp: expect.any(Number), + event_id: expect.any(String), + environment: 'production', message: 'foo', sdkProcessingMetadata: { propagationContext: { @@ -140,6 +165,10 @@ describe('Unit | Scope', () => { const eventProcessor2 = jest.fn((b: unknown) => b) as EventProcessor; const eventProcessor3 = jest.fn((c: unknown) => c) as EventProcessor; + const attachment1 = { filename: '1' } as Attachment; + const attachment2 = { filename: '2' } as Attachment; + const attachment3 = { filename: '3' } as Attachment; + const scope = new Scope(); scope.update({ user: { id: '1', email: 'test@example.com' }, @@ -151,6 +180,7 @@ describe('Unit | Scope', () => { }); scope.addBreadcrumb(breadcrumb1); scope.addEventProcessor(eventProcessor1); + scope.addAttachment(attachment1); const globalScope = getGlobalScope(); const isolationScope = getIsolationScope(); @@ -158,16 +188,39 @@ describe('Unit | Scope', () => { globalScope.addBreadcrumb(breadcrumb2); globalScope.addEventProcessor(eventProcessor2); globalScope.setSDKProcessingMetadata({ aa: 'aa' }); + globalScope.addAttachment(attachment2); isolationScope.addBreadcrumb(breadcrumb3); isolationScope.addEventProcessor(eventProcessor3); - globalScope.setSDKProcessingMetadata({ bb: 'bb' }); + isolationScope.setSDKProcessingMetadata({ bb: 'bb' }); + isolationScope.addAttachment(attachment3); const event = { message: 'foo', breadcrumbs: [breadcrumb4], fingerprint: ['dd'] }; - applyScopeDataToEvent(event, scope.getScopeData()); + const options = {} as ClientOptions; + const processedEvent = await prepareEvent( + options, + event, + { + integrations: [], + }, + scope, + ); + + expect(eventProcessor1).toHaveBeenCalledTimes(1); + expect(eventProcessor2).toHaveBeenCalledTimes(1); + expect(eventProcessor3).toHaveBeenCalledTimes(1); + + // Test that attachments are correctly merged + expect(eventProcessor1).toHaveBeenCalledWith(processedEvent, { + integrations: [], + attachments: [attachment2, attachment3, attachment1], + }); - expect(event).toEqual({ + expect(processedEvent).toEqual({ + timestamp: expect.any(Number), + event_id: expect.any(String), + environment: 'production', message: 'foo', user: { id: '1', email: 'test@example.com' }, tags: { tag1: 'aa', tag2: 'aa' }, @@ -186,35 +239,4 @@ describe('Unit | Scope', () => { }); }); }); - - describe('getAttachments', () => { - it('works without any data', async () => { - mockSdkInit(); - - const scope = new Scope(); - - const actual = scope.getAttachments(); - expect(actual).toEqual([]); - }); - - it('merges attachments data', async () => { - mockSdkInit(); - - const attachment1 = { filename: '1' } as Attachment; - const attachment2 = { filename: '2' } as Attachment; - const attachment3 = { filename: '3' } as Attachment; - - const scope = new Scope(); - scope.addAttachment(attachment1); - - const globalScope = getGlobalScope(); - const isolationScope = getIsolationScope(); - - globalScope.addAttachment(attachment2); - isolationScope.addAttachment(attachment3); - - const actual = scope.getAttachments(); - expect(actual).toEqual([attachment2, attachment3, attachment1]); - }); - }); }); diff --git a/packages/types/src/scope.ts b/packages/types/src/scope.ts index 8cee38ca50ab..50ef4da5987f 100644 --- a/packages/types/src/scope.ts +++ b/packages/types/src/scope.ts @@ -53,9 +53,6 @@ export interface Scope { /** Get the data of this scope, which is applied to an event during processing. */ getScopeData(): ScopeData; - /** Get the data of this scope only, ignoring all other related scopes. */ - getPerScopeData(): ScopeData; - /** * Updates user context information for future events. *