11/* eslint-disable max-lines */ // TODO: We might want to split this file up
22import { addGlobalEventProcessor , captureException , getCurrentHub , setContext } from '@sentry/core' ;
3- import { Breadcrumb , ReplayEvent , TransportMakeRequestResponse } from '@sentry/types' ;
3+ import type { Breadcrumb , ReplayEvent , ReplayRecordingMode , TransportMakeRequestResponse } from '@sentry/types' ;
44import { addInstrumentationHandler , logger } from '@sentry/utils' ;
55import { EventType , record } from 'rrweb' ;
66
@@ -34,7 +34,6 @@ import type {
3434 RecordingOptions ,
3535 ReplayContainer as ReplayContainerInterface ,
3636 ReplayPluginOptions ,
37- ReplayRecordingMode ,
3837 SendReplay ,
3938 Session ,
4039} from './types' ;
@@ -922,7 +921,7 @@ export class ReplayContainer implements ReplayContainerInterface {
922921 const transport = client && client . getTransport ( ) ;
923922 const dsn = client ?. getDsn ( ) ;
924923
925- if ( ! client || ! scope || ! transport || ! dsn ) {
924+ if ( ! client || ! scope || ! transport || ! dsn || ! this . session || ! this . session . sampled ) {
926925 return ;
927926 }
928927
@@ -936,7 +935,7 @@ export class ReplayContainer implements ReplayContainerInterface {
936935 urls,
937936 replay_id : replayId ,
938937 segment_id,
939- replay_type : this . session ? .sampled ,
938+ replay_type : this . session . sampled ,
940939 } ;
941940
942941 const replayEvent = await getReplayEvent ( { scope, client, replayId, event : baseEvent } ) ;
0 commit comments