diff --git a/packages/replay-internal/src/replay.ts b/packages/replay-internal/src/replay.ts index 22e2dcd927aa..d746ae41b026 100644 --- a/packages/replay-internal/src/replay.ts +++ b/packages/replay-internal/src/replay.ts @@ -387,7 +387,7 @@ export class ReplayContainer implements ReplayContainerInterface { // increases replay size) this._options._experiments.continuousCheckout && { // Minimum checkout time is 6 minutes - checkoutEveryNms: Math.min(360_000, this._options._experiments.continuousCheckout), + checkoutEveryNms: Math.max(360_000, this._options._experiments.continuousCheckout), }), emit: getHandleRecordingEmit(this), onMutation: this._onMutationHandler, @@ -400,8 +400,6 @@ export class ReplayContainer implements ReplayContainerInterface { } : {}), }); - - console.log('continuousCheckout', this._options._experiments); } catch (err) { this._handleException(err); } diff --git a/packages/replay-internal/test/integration/rrweb.test.ts b/packages/replay-internal/test/integration/rrweb.test.ts index 863baab45bce..4327ddb21de1 100644 --- a/packages/replay-internal/test/integration/rrweb.test.ts +++ b/packages/replay-internal/test/integration/rrweb.test.ts @@ -46,4 +46,44 @@ describe('Integration | rrweb', () => { } `); }); + + it('calls rrweb.record with checkoutEveryNms', async () => { + const { mockRecord } = await resetSdkMock({ + replayOptions: { + _experiments: { + continuousCheckout: 1, + }, + }, + sentryOptions: { + replaysOnErrorSampleRate: 0.0, + replaysSessionSampleRate: 1.0, + }, + }); + + expect(mockRecord.mock.calls[0]?.[0]).toMatchInlineSnapshot(` + { + "blockSelector": ".sentry-block,[data-sentry-block],base[href="/"],img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]", + "checkoutEveryNms": 360000, + "collectFonts": true, + "emit": [Function], + "errorHandler": [Function], + "ignoreSelector": ".sentry-ignore,[data-sentry-ignore],input[type="file"]", + "inlineImages": false, + "inlineStylesheet": true, + "maskAllInputs": true, + "maskAllText": true, + "maskAttributeFn": [Function], + "maskInputFn": undefined, + "maskInputOptions": { + "password": true, + }, + "maskTextFn": undefined, + "maskTextSelector": ".sentry-mask,[data-sentry-mask]", + "onMutation": [Function], + "slimDOMOptions": "all", + "unblockSelector": "", + "unmaskTextSelector": "", + } + `); + }); });