Skip to content

Commit 0bf771c

Browse files
chore: fix broken nightly test (#1560)
1 parent a43db24 commit 0bf771c

File tree

1 file changed

+4
-4
lines changed
  • src/features/session_replay/instrument

1 file changed

+4
-4
lines changed

src/features/session_replay/instrument/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { handle } from '../../../common/event-emitter/handle'
1010
import { DEFAULT_KEY, MODE, PREFIX } from '../../../common/session/constants'
1111
import { InstrumentBase } from '../../utils/instrument-base'
1212
import { hasReplayPrerequisite, isPreloadAllowed } from '../shared/utils'
13-
import { FEATURE_NAME, SR_EVENT_EMITTER_TYPES } from '../constants'
13+
import { FEATURE_NAME, SR_EVENT_EMITTER_TYPES, TRIGGERS } from '../constants'
1414
import { setupRecordReplayAPI } from '../../../loaders/api/recordReplay'
1515
import { setupPauseReplayAPI } from '../../../loaders/api/pauseReplay'
1616

@@ -69,7 +69,7 @@ export class Instrument extends InstrumentBase {
6969
/**
7070
* This func is use for early pre-load recording prior to replay feature (agg) being loaded onto the page. It should only setup once, including if already called and in-progress.
7171
*/
72-
async #preloadStartRecording () {
72+
async #preloadStartRecording (trigger) {
7373
if (this.#alreadyStarted) return
7474
this.#alreadyStarted = true
7575

@@ -78,7 +78,7 @@ export class Instrument extends InstrumentBase {
7878

7979
// If startReplay() has been used by this point, we must record in full mode regardless of session preload:
8080
// Note: recorder starts here with w/e the mode is at this time, but this may be changed later (see #apiStartOrRestartReplay else-case)
81-
this.recorder ??= new Recorder({ ...this, mode: this.#mode, agentRef: this.#agentRef, timeKeeper: this.#agentRef.runtime.timeKeeper }) // if TK exists due to deferred state, pass it
81+
this.recorder ??= new Recorder({ ...this, mode: this.#mode, agentRef: this.#agentRef, trigger, timeKeeper: this.#agentRef.runtime.timeKeeper }) // if TK exists due to deferred state, pass it
8282
this.recorder.startRecording()
8383
this.abortHandler = this.recorder.stopRecording
8484
} catch (err) {
@@ -95,7 +95,7 @@ export class Instrument extends InstrumentBase {
9595
if (this.featAggregate.mode !== MODE.FULL) this.featAggregate.initializeRecording(MODE.FULL, true)
9696
} else { // pre-load
9797
this.#mode = MODE.FULL
98-
this.#preloadStartRecording()
98+
this.#preloadStartRecording(TRIGGERS.API)
9999
// There's a race here wherein either:
100100
// a. Recorder has not been initialized, and we've set the enforced mode, so we're good, or;
101101
// b. Record has been initialized, possibly with the "wrong" mode, so we have to correct that + restart.

0 commit comments

Comments
 (0)