Skip to content

Commit

Permalink
fix(core): Include _sdkProcessingMetadata when cloning scope (#6218)
Browse files Browse the repository at this point in the history
When I added the `_sdkProcessingMetadata` field to `Scope`, I missed adding it to the `clone` method. This fixes that.

Addresses the `withScope` problem mentioned in #6139 (comment). (TL;DR - the stored request upon which the `RequestData` integration relies was getting lost when `withScope` was called, which in turn meant that no request data was coming through.)
  • Loading branch information
lobsterkatie committed Nov 17, 2022
1 parent 62ad0f3 commit 8fdc401
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/scope.ts
Expand Up @@ -95,6 +95,8 @@ export class Scope implements ScopeInterface {
/** Request Mode Session Status */
protected _requestSession?: RequestSession;

// NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.

public constructor() {
this._notifyingListeners = false;
this._scopeListeners = [];
Expand Down Expand Up @@ -128,6 +130,7 @@ export class Scope implements ScopeInterface {
newScope._eventProcessors = [...scope._eventProcessors];
newScope._requestSession = scope._requestSession;
newScope._attachments = [...scope._attachments];
newScope._sdkProcessingMetadata = { ...scope._sdkProcessingMetadata };
}
return newScope;
}
Expand Down

0 comments on commit 8fdc401

Please sign in to comment.