@@ -170,7 +170,7 @@ export function setContext(
170
170
/** Start a session on the current isolation scope. */
171
171
export function startSession ( context ?: Session ) : Session {
172
172
const client = getClient ( ) ;
173
- const scope = getIsolationScope ( ) ;
173
+ const isolationScope = getIsolationScope ( ) ;
174
174
175
175
const { release, environment = DEFAULT_ENVIRONMENT } = client . getOptions ( ) ;
176
176
@@ -180,35 +180,35 @@ export function startSession(context?: Session): Session {
180
180
const session = makeSession ( {
181
181
release,
182
182
environment,
183
- user : scope . getUser ( ) ,
183
+ user : isolationScope . getUser ( ) ,
184
184
...( userAgent && { userAgent } ) ,
185
185
...context ,
186
186
} ) ;
187
187
188
188
// End existing session if there's one
189
- const currentSession = scope . getSession && scope . getSession ( ) ;
189
+ const currentSession = isolationScope . getSession && isolationScope . getSession ( ) ;
190
190
if ( currentSession && currentSession . status === 'ok' ) {
191
191
updateSession ( currentSession , { status : 'exited' } ) ;
192
192
}
193
193
endSession ( ) ;
194
194
195
195
// Afterwards we set the new session on the scope
196
- scope . setSession ( session ) ;
196
+ isolationScope . setSession ( session ) ;
197
197
198
198
return session ;
199
199
}
200
200
201
201
/** End the session on the current isolation scope. */
202
202
export function endSession ( ) : void {
203
- const scope = getIsolationScope ( ) ;
204
- const session = scope . getSession ( ) ;
203
+ const isolationScope = getIsolationScope ( ) ;
204
+ const session = isolationScope . getSession ( ) ;
205
205
if ( session ) {
206
206
closeSession ( session ) ;
207
207
}
208
208
_sendSessionUpdate ( ) ;
209
209
210
210
// the session is over; take it off of the scope
211
- scope . setSession ( ) ;
211
+ isolationScope . setSession ( ) ;
212
212
}
213
213
214
214
/**
0 commit comments