Skip to content

Commit daa8917

Browse files
committed
fix(replay): Fix checkoutEveryNms
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 e26e835 commit daa8917

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
@@ -179,10 +179,8 @@ export class ReplayContainer implements ReplayContainerInterface {
179179
return;
180180
}
181181

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

0 commit comments

Comments
 (0)