Skip to content
Merged
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
45 changes: 29 additions & 16 deletions packages/hub/src/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,37 @@ const MAX_BREADCRUMBS = 100;
*/
export class Scope implements ScopeInterface {
/** Flag if notifying is happening. */
protected _notifyingListeners: boolean = false;
protected _notifyingListeners: boolean;

/** Callback for client to receive scope changes. */
protected _scopeListeners: Array<(scope: Scope) => void> = [];
protected _scopeListeners: Array<(scope: Scope) => void>;

/** Callback list that will be called after {@link applyToEvent}. */
protected _eventProcessors: EventProcessor[] = [];
protected _eventProcessors: EventProcessor[];

/** Array of breadcrumbs. */
protected _breadcrumbs: Breadcrumb[] = [];
protected _breadcrumbs: Breadcrumb[];

/** User */
protected _user: User = {};
protected _user: User;

/** Tags */
protected _tags: { [key: string]: Primitive } = {};
protected _tags: { [key: string]: Primitive };

/** Extra */
protected _extra: Extras = {};
protected _extra: Extras;

/** Contexts */
protected _contexts: Contexts = {};
protected _contexts: Contexts;

/** Attachments */
protected _attachments: Attachment[];

/**
* A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get
* sent to Sentry
*/
protected _sdkProcessingMetadata: { [key: string]: unknown };

/** Fingerprint */
protected _fingerprint?: string[];
Expand All @@ -86,14 +95,18 @@ export class Scope implements ScopeInterface {
/** Request Mode Session Status */
protected _requestSession?: RequestSession;

/** Attachments */
protected _attachments: Attachment[] = [];

/**
* A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get
* sent to Sentry
*/
protected _sdkProcessingMetadata?: { [key: string]: unknown } = {};
public constructor() {
this._notifyingListeners = false;
this._scopeListeners = [];
this._eventProcessors = [];
this._breadcrumbs = [];
this._attachments = [];
this._user = {};
this._tags = {};
this._extra = {};
this._contexts = {};
this._sdkProcessingMetadata = {};
}

/**
* Inherit values from the parent scope.
Expand Down