66 withIsolationScope ,
77 withScope ,
88} from '../../src' ;
9- import type { Breadcrumb , Client , Event , RequestSessionStatus } from '../../src/types-hoist' ;
9+ import type { Breadcrumb , Client , Event } from '../../src/types-hoist' ;
1010
1111import { Scope } from '../../src/scope' ;
1212import { TestClient , getDefaultTestClientOptions } from '../mocks/client' ;
@@ -259,15 +259,6 @@ describe('Scope', () => {
259259 expect ( parentScope [ '_extra' ] ) . toEqual ( scope [ '_extra' ] ) ;
260260 } ) ;
261261
262- test ( '_requestSession clone' , ( ) => {
263- const parentScope = new Scope ( ) ;
264- // eslint-disable-next-line deprecation/deprecation
265- parentScope . setRequestSession ( { status : 'errored' } ) ;
266- const scope = parentScope . clone ( ) ;
267- // eslint-disable-next-line deprecation/deprecation
268- expect ( parentScope . getRequestSession ( ) ) . toEqual ( scope . getRequestSession ( ) ) ;
269- } ) ;
270-
271262 test ( 'parent changed inheritance' , ( ) => {
272263 const parentScope = new Scope ( ) ;
273264 const scope = parentScope . clone ( ) ;
@@ -286,26 +277,6 @@ describe('Scope', () => {
286277 expect ( scope [ '_extra' ] ) . toEqual ( { a : 2 } ) ;
287278 } ) ;
288279
289- test ( 'child override should set the value of parent _requestSession' , ( ) => {
290- // Test that ensures if the status value of `status` of `_requestSession` is changed in a child scope
291- // that it should also change in parent scope because we are copying the reference to the object
292- const parentScope = new Scope ( ) ;
293- // eslint-disable-next-line deprecation/deprecation
294- parentScope . setRequestSession ( { status : 'errored' } ) ;
295-
296- const scope = parentScope . clone ( ) ;
297- // eslint-disable-next-line deprecation/deprecation
298- const requestSession = scope . getRequestSession ( ) ;
299- if ( requestSession ) {
300- requestSession . status = 'ok' ;
301- }
302-
303- // eslint-disable-next-line deprecation/deprecation
304- expect ( parentScope . getRequestSession ( ) ) . toEqual ( { status : 'ok' } ) ;
305- // eslint-disable-next-line deprecation/deprecation
306- expect ( scope . getRequestSession ( ) ) . toEqual ( { status : 'ok' } ) ;
307- } ) ;
308-
309280 test ( 'should clone propagation context' , ( ) => {
310281 const parentScope = new Scope ( ) ;
311282 const scope = parentScope . clone ( ) ;
@@ -322,12 +293,9 @@ describe('Scope', () => {
322293 scope . setUser ( { id : '1' } ) ;
323294 scope . setFingerprint ( [ 'abcd' ] ) ;
324295 scope . addBreadcrumb ( { message : 'test' } ) ;
325- // eslint-disable-next-line deprecation/deprecation
326- scope . setRequestSession ( { status : 'ok' } ) ;
327296 expect ( scope [ '_extra' ] ) . toEqual ( { a : 2 } ) ;
328297 scope . clear ( ) ;
329298 expect ( scope [ '_extra' ] ) . toEqual ( { } ) ;
330- expect ( scope [ '_requestSession' ] ) . toEqual ( undefined ) ;
331299 expect ( scope [ '_propagationContext' ] ) . toEqual ( {
332300 traceId : expect . any ( String ) ,
333301 spanId : expect . any ( String ) ,
@@ -356,8 +324,6 @@ describe('Scope', () => {
356324 scope . setUser ( { id : '1337' } ) ;
357325 scope . setLevel ( 'info' ) ;
358326 scope . setFingerprint ( [ 'foo' ] ) ;
359- // eslint-disable-next-line deprecation/deprecation
360- scope . setRequestSession ( { status : 'ok' } ) ;
361327 } ) ;
362328
363329 test ( 'given no data, returns the original scope' , ( ) => {
@@ -405,7 +371,6 @@ describe('Scope', () => {
405371 localScope . setUser ( { id : '42' } ) ;
406372 localScope . setLevel ( 'warning' ) ;
407373 localScope . setFingerprint ( [ 'bar' ] ) ;
408- ( localScope as any ) . _requestSession = { status : 'ok' } ;
409374
410375 const updatedScope = scope . update ( localScope ) as any ;
411376
@@ -427,7 +392,6 @@ describe('Scope', () => {
427392 expect ( updatedScope . _user ) . toEqual ( { id : '42' } ) ;
428393 expect ( updatedScope . _level ) . toEqual ( 'warning' ) ;
429394 expect ( updatedScope . _fingerprint ) . toEqual ( [ 'bar' ] ) ;
430- expect ( updatedScope . _requestSession . status ) . toEqual ( 'ok' ) ;
431395 // @ts -expect-error accessing private property for test
432396 expect ( updatedScope . _propagationContext ) . toEqual ( localScope . _propagationContext ) ;
433397 } ) ;
@@ -450,7 +414,6 @@ describe('Scope', () => {
450414 expect ( updatedScope . _user ) . toEqual ( { id : '1337' } ) ;
451415 expect ( updatedScope . _level ) . toEqual ( 'info' ) ;
452416 expect ( updatedScope . _fingerprint ) . toEqual ( [ 'foo' ] ) ;
453- expect ( updatedScope . _requestSession . status ) . toEqual ( 'ok' ) ;
454417 } ) ;
455418
456419 test ( 'given a plain object, it should merge two together, with the passed object having priority' , ( ) => {
@@ -461,8 +424,6 @@ describe('Scope', () => {
461424 level : 'warning' as const ,
462425 tags : { bar : '3' , baz : '4' } ,
463426 user : { id : '42' } ,
464- // eslint-disable-next-line deprecation/deprecation
465- requestSession : { status : 'errored' as RequestSessionStatus } ,
466427 propagationContext : {
467428 traceId : '8949daf83f4a4a70bee4c1eb9ab242ed' ,
468429 spanId : 'a024ad8fea82680e' ,
@@ -490,7 +451,6 @@ describe('Scope', () => {
490451 expect ( updatedScope . _user ) . toEqual ( { id : '42' } ) ;
491452 expect ( updatedScope . _level ) . toEqual ( 'warning' ) ;
492453 expect ( updatedScope . _fingerprint ) . toEqual ( [ 'bar' ] ) ;
493- expect ( updatedScope . _requestSession ) . toEqual ( { status : 'errored' } ) ;
494454 expect ( updatedScope . _propagationContext ) . toEqual ( {
495455 traceId : '8949daf83f4a4a70bee4c1eb9ab242ed' ,
496456 spanId : 'a024ad8fea82680e' ,
0 commit comments