Skip to content

Commit 8fdc401

Browse files
authored
fix(core): Include _sdkProcessingMetadata when cloning scope (#6218)
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.)
1 parent 62ad0f3 commit 8fdc401

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/core/src/scope.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ export class Scope implements ScopeInterface {
9595
/** Request Mode Session Status */
9696
protected _requestSession?: RequestSession;
9797

98+
// NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.
99+
98100
public constructor() {
99101
this._notifyingListeners = false;
100102
this._scopeListeners = [];
@@ -128,6 +130,7 @@ export class Scope implements ScopeInterface {
128130
newScope._eventProcessors = [...scope._eventProcessors];
129131
newScope._requestSession = scope._requestSession;
130132
newScope._attachments = [...scope._attachments];
133+
newScope._sdkProcessingMetadata = { ...scope._sdkProcessingMetadata };
131134
}
132135
return newScope;
133136
}

0 commit comments

Comments
 (0)