Skip to content

Commit 9730647

Browse files
committed
PR feedback
1 parent 85ca789 commit 9730647

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

packages/node-experimental/src/sdk/api.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export function setContext(
170170
/** Start a session on the current isolation scope. */
171171
export function startSession(context?: Session): Session {
172172
const client = getClient();
173-
const scope = getIsolationScope();
173+
const isolationScope = getIsolationScope();
174174

175175
const { release, environment = DEFAULT_ENVIRONMENT } = client.getOptions();
176176

@@ -180,35 +180,35 @@ export function startSession(context?: Session): Session {
180180
const session = makeSession({
181181
release,
182182
environment,
183-
user: scope.getUser(),
183+
user: isolationScope.getUser(),
184184
...(userAgent && { userAgent }),
185185
...context,
186186
});
187187

188188
// End existing session if there's one
189-
const currentSession = scope.getSession && scope.getSession();
189+
const currentSession = isolationScope.getSession && isolationScope.getSession();
190190
if (currentSession && currentSession.status === 'ok') {
191191
updateSession(currentSession, { status: 'exited' });
192192
}
193193
endSession();
194194

195195
// Afterwards we set the new session on the scope
196-
scope.setSession(session);
196+
isolationScope.setSession(session);
197197

198198
return session;
199199
}
200200

201201
/** End the session on the current isolation scope. */
202202
export function endSession(): void {
203-
const scope = getIsolationScope();
204-
const session = scope.getSession();
203+
const isolationScope = getIsolationScope();
204+
const session = isolationScope.getSession();
205205
if (session) {
206206
closeSession(session);
207207
}
208208
_sendSessionUpdate();
209209

210210
// the session is over; take it off of the scope
211-
scope.setSession();
211+
isolationScope.setSession();
212212
}
213213

214214
/**

packages/node-experimental/src/sdk/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ export class NodeExperimentalClient extends NodeClient {
6464

6565
// Remove `captureContext` hint and instead clone already here
6666
if (hint && hint.captureContext) {
67-
actualScope = getFinalScope(scope, hint.captureContext);
67+
actualScope = getScopeForEvent(scope, hint.captureContext);
6868
delete hint.captureContext;
6969
}
7070

7171
return super._prepareEvent(event, hint, actualScope);
7272
}
7373
}
7474

75-
function getFinalScope(scope: Scope | undefined, captureContext: CaptureContext): Scope | undefined {
75+
function getScopeForEvent(scope: Scope | undefined, captureContext: CaptureContext): Scope | undefined {
7676
const finalScope = scope ? scope.clone() : new Scope();
7777
finalScope.update(captureContext);
7878
return finalScope;

0 commit comments

Comments
 (0)