Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[recorder] set 'hasReplay' to undefined by default #697

Merged
merged 2 commits into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/rum-core/src/rawRumEvent.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,5 @@ export interface User {
export interface CommonContext {
user: User
context: Context
hasReplay?: boolean
hasReplay?: true
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/rum-recorder/src/boot/rumRecorderPublicApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down