diff --git a/src/__tests__/extensions/sessionrecording.ts b/src/__tests__/extensions/sessionrecording.ts index f78b2d743..917d86c70 100644 --- a/src/__tests__/extensions/sessionrecording.ts +++ b/src/__tests__/extensions/sessionrecording.ts @@ -5,6 +5,7 @@ import { RECORDING_IDLE_ACTIVITY_TIMEOUT_MS, RECORDING_MAX_EVENT_SIZE, SessionRecording, + TEN_MINUTES_IN_MS, } from '../../extensions/sessionrecording' import { PostHogPersistence } from '../../posthog-persistence' import { @@ -263,6 +264,7 @@ describe('SessionRecording', () => { plugins: [], inlineStylesheet: true, recordCrossOriginIframes: false, + checkoutEveryNms: TEN_MINUTES_IN_MS, }) }) diff --git a/src/extensions/sessionrecording.ts b/src/extensions/sessionrecording.ts index e406c8411..1efc5ac36 100644 --- a/src/extensions/sessionrecording.ts +++ b/src/extensions/sessionrecording.ts @@ -22,6 +22,7 @@ import { logger, loadScript, _timestamp, window } from '../utils' const BASE_ENDPOINT = '/s/' export const RECORDING_IDLE_ACTIVITY_TIMEOUT_MS = 5 * 60 * 1000 // 5 minutes +export const TEN_MINUTES_IN_MS = 10 * 60 * 1000 export const RECORDING_MAX_EVENT_SIZE = 1024 * 1024 * 0.9 // ~1mb (with some wiggle room) export const RECORDING_BUFFER_TIMEOUT = 2000 // 2 seconds export const SESSION_RECORDING_BATCH_KEY = 'recordings' @@ -326,6 +327,8 @@ export class SessionRecording { collectFonts: false, inlineStylesheet: true, recordCrossOriginIframes: false, + //take a full snapshot after every N ms + checkoutEveryNms: TEN_MINUTES_IN_MS, } // We switched from loading all of rrweb to just the record part, but // keep backwards compatibility if someone hasn't upgraded PostHog