diff --git a/packages/rum-core/src/rawRumEvent.types.ts b/packages/rum-core/src/rawRumEvent.types.ts index b425d42a92..d78b9d8398 100644 --- a/packages/rum-core/src/rawRumEvent.types.ts +++ b/packages/rum-core/src/rawRumEvent.types.ts @@ -176,5 +176,5 @@ export interface User { export interface CommonContext { user: User context: Context - hasReplay?: boolean + hasReplay?: true } diff --git a/packages/rum-recorder/src/boot/rumRecorderPublicApi.spec.ts b/packages/rum-recorder/src/boot/rumRecorderPublicApi.spec.ts index 38ee85b32f..c16925cb60 100644 --- a/packages/rum-recorder/src/boot/rumRecorderPublicApi.spec.ts +++ b/packages/rum-recorder/src/boot/rumRecorderPublicApi.spec.ts @@ -70,7 +70,7 @@ describe('makeRumRecorderPublicApi', () => { it('if enabled, commonContext.hasReplay should be true only if startSessionRecord is called', () => { enabledFlags = ['postpone_start_recording'] rumGlobal.init(DEFAULT_INIT_CONFIGURATION) - expect(getCommonContext().hasReplay).toBe(false) + expect(getCommonContext().hasReplay).toBeUndefined() rumGlobal.startSessionRecord!() expect(getCommonContext().hasReplay).toBe(true) }) diff --git a/packages/rum-recorder/src/boot/rumRecorderPublicApi.ts b/packages/rum-recorder/src/boot/rumRecorderPublicApi.ts index 79163fda19..e13244c5c4 100644 --- a/packages/rum-recorder/src/boot/rumRecorderPublicApi.ts +++ b/packages/rum-recorder/src/boot/rumRecorderPublicApi.ts @@ -7,7 +7,7 @@ export type StartRecording = typeof startRecording export function makeRumRecorderPublicApi(startRumImpl: StartRum, startRecordingImpl: StartRecording) { const rumRecorderGlobal = makeRumPublicApi((userConfiguration, getCommonContext) => { - let isRecording = false + let isRecording: true | undefined const startRumResult = startRumImpl(userConfiguration, () => ({ ...getCommonContext(),