@@ -70,7 +70,7 @@ export class ReplayContainer implements ReplayContainerInterface {
7070 * * session: Record the whole session, sending it continuously
7171 * * error: Always keep the last 60s of recording, and when an error occurs, send it immediately
7272 */
73- public mode : ReplayRecordingMode = 'session' ;
73+ public recordingMode : ReplayRecordingMode = 'session' ;
7474
7575 /**
7676 * Options to pass to `rrweb.record()`
@@ -175,7 +175,7 @@ export class ReplayContainer implements ReplayContainerInterface {
175175 // when an error will occur, so we need to keep a buffer of
176176 // replay events.
177177 if ( this . session . sampled === 'error' ) {
178- this . mode = 'error' ;
178+ this . recordingMode = 'error' ;
179179 }
180180
181181 // setup() is generally called on page load or manually - in both cases we
@@ -205,7 +205,7 @@ export class ReplayContainer implements ReplayContainerInterface {
205205 // When running in error sampling mode, we need to overwrite `checkoutEveryNth`
206206 // Without this, it would record forever, until an error happens, which we don't want
207207 // instead, we'll always keep the last 60 seconds of replay before an error happened
208- ...( this . mode === 'error' && { checkoutEveryNth : 60000 } ) ,
208+ ...( this . recordingMode === 'error' && { checkoutEveryNth : 60000 } ) ,
209209 emit : this . handleRecordingEmit ,
210210 } ) ;
211211 } catch ( err ) {
@@ -405,12 +405,12 @@ export class ReplayContainer implements ReplayContainerInterface {
405405 * processing and hand back control to caller.
406406 */
407407 addUpdate ( cb : AddUpdateCallback ) : void {
408- // We need to always run `cb` (e.g. in the case of `this.mode == 'error'`)
408+ // We need to always run `cb` (e.g. in the case of `this.recordingMode == 'error'`)
409409 const cbResult = cb ?.( ) ;
410410
411411 // If this option is turned on then we will only want to call `flush`
412412 // explicitly
413- if ( this . mode === 'error' ) {
413+ if ( this . recordingMode === 'error' ) {
414414 return ;
415415 }
416416
@@ -447,7 +447,7 @@ export class ReplayContainer implements ReplayContainerInterface {
447447 // when an error occurs. Clear any state that happens before this current
448448 // checkout. This needs to happen before `addEvent()` which updates state
449449 // dependent on this reset.
450- if ( this . mode === 'error' && event . type === 2 ) {
450+ if ( this . recordingMode === 'error' && event . type === 2 ) {
451451 this . setInitialState ( ) ;
452452 }
453453
@@ -473,7 +473,7 @@ export class ReplayContainer implements ReplayContainerInterface {
473473
474474 // See note above re: session start needs to reflect the most recent
475475 // checkout.
476- if ( this . mode === 'error' && this . session && this . _context . earliestEvent ) {
476+ if ( this . recordingMode === 'error' && this . session && this . _context . earliestEvent ) {
477477 this . session . started = this . _context . earliestEvent ;
478478 this . _maybeSaveSession ( ) ;
479479 }
@@ -746,10 +746,10 @@ export class ReplayContainer implements ReplayContainerInterface {
746746 }
747747
748748 /**
749- * Only flush if `this.mode === 'session'`
749+ * Only flush if `this.recordingMode === 'session'`
750750 */
751751 conditionalFlush ( ) : void {
752- if ( this . mode === 'error' ) {
752+ if ( this . recordingMode === 'error' ) {
753753 return ;
754754 }
755755
0 commit comments