Skip to content

Commit b250f9f

Browse files
authored
fix(replay): Fix checkoutEveryNms (#6722)
This was inadvertantly changed and was causing replays to have very long durations since it was waiting for 60k events before resetting buffer. Fixes #6720
1 parent 23dbd45 commit b250f9f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/replay/src/replay.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,8 @@ export class ReplayContainer implements ReplayContainerInterface {
178178
return;
179179
}
180180

181-
// Modify recording options to checkoutEveryNthSecond if
182-
// sampling for error replay. This is because we don't know
183-
// when an error will occur, so we need to keep a buffer of
184-
// replay events.
181+
// If session is sampled for errors, then we need to set the recordingMode
182+
// to 'error', which will configure recording with different options.
185183
if (this.session.sampled === 'error') {
186184
this.recordingMode = 'error';
187185
}
@@ -211,10 +209,10 @@ export class ReplayContainer implements ReplayContainerInterface {
211209
try {
212210
this._stopRecording = record({
213211
...this._recordingOptions,
214-
// When running in error sampling mode, we need to overwrite `checkoutEveryNth`
212+
// When running in error sampling mode, we need to overwrite `checkoutEveryNms`
215213
// Without this, it would record forever, until an error happens, which we don't want
216214
// instead, we'll always keep the last 60 seconds of replay before an error happened
217-
...(this.recordingMode === 'error' && { checkoutEveryNth: 60000 }),
215+
...(this.recordingMode === 'error' && { checkoutEveryNms: 60000 }),
218216
emit: this.handleRecordingEmit,
219217
});
220218
} catch (err) {

0 commit comments

Comments
 (0)