@@ -185,7 +185,10 @@ export class ReplayContainer {
185
185
try {
186
186
this . _stopRecording = record ( {
187
187
...this . recordingOptions ,
188
- ...this . _getRecordingOptionsOverwrites ( ) ,
188
+ // When running in error sampling mode, we need to overwrite `checkoutEveryNth`
189
+ // Without this, it would record forever, until an error happens, which we don't want
190
+ // instead, we'll always keep the last 60 seconds of replay before an error happened
191
+ ...( this . _waitForError && { checkoutEveryNth : 60000 } ) ,
189
192
emit : this . handleRecordingEmit ,
190
193
} ) ;
191
194
} catch ( err ) {
@@ -1281,16 +1284,4 @@ export class ReplayContainer {
1281
1284
1282
1285
client . recordDroppedEvent = this . _originalRecordDroppedEvent ;
1283
1286
}
1284
-
1285
- /** Additional recordingOptions that should take precedence over user config */
1286
- private _getRecordingOptionsOverwrites ( ) : Partial < RecordingOptions > {
1287
- return this . _waitForError
1288
- ? {
1289
- // Checkout every minute, meaning we only get up-to one minute of events before the error happens
1290
- // Without this, it would record forever, until an error happens, which we don't want
1291
- // instead, we'll always keep the last 60 seconds of replay before an error happened
1292
- checkoutEveryNth : 60000 ,
1293
- }
1294
- : { } ;
1295
- }
1296
1287
}
0 commit comments