Skip to content

Commit 4f6f301

Browse files
committed
address PR feedback
1 parent ecc6cb2 commit 4f6f301

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/core/src/logs/exports.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export function _INTERNAL_captureLog(
120120
...beforeLog.attributes,
121121
};
122122

123-
const { user } = getScopeData(currentScope);
123+
const { user } = getMergedScopeData(currentScope);
124124
// Only attach user to log attributes if sendDefaultPii is enabled
125125
if (client.getOptions().sendDefaultPii) {
126126
const { id, email, username } = user;
@@ -238,16 +238,15 @@ export function _INTERNAL_getLogBuffer(client: Client): Array<SerializedLog> | u
238238
}
239239

240240
/**
241-
* Get the scope data for the current scope.
241+
* Get the scope data for the current scope after merging with the
242+
* global scope and isolation scope.
243+
*
242244
* @param currentScope - The current scope.
243245
* @returns The scope data.
244246
*/
245-
function getScopeData(currentScope: Scope): ScopeData {
247+
function getMergedScopeData(currentScope: Scope): ScopeData {
246248
const scopeData = getGlobalScope().getScopeData();
247-
const isolationScope = getIsolationScope();
248-
if (isolationScope) {
249-
mergeScopeData(scopeData, isolationScope.getScopeData());
250-
}
249+
mergeScopeData(scopeData, getIsolationScope().getScopeData());
251250
mergeScopeData(scopeData, currentScope.getScopeData());
252251
return scopeData;
253252
}

0 commit comments

Comments
 (0)