@newrelic/browser-agent 1.296.0-rc.5 → 1.296.0-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.DIST_METHOD = exports.BUILD_EN
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.296.0-rc.5";
20
+ const VERSION = exports.VERSION = "1.296.0-rc.6";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.DIST_METHOD = exports.BUILD_EN
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.296.0-rc.5";
20
+ const VERSION = exports.VERSION = "1.296.0-rc.6";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -70,7 +70,7 @@ class Instrument extends _instrumentBase.InstrumentBase {
70
70
  /**
71
71
  * 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.
72
72
  */
73
- async #preloadStartRecording() {
73
+ async #preloadStartRecording(trigger) {
74
74
  if (this.#alreadyStarted) return;
75
75
  this.#alreadyStarted = true;
76
76
  try {
@@ -84,6 +84,7 @@ class Instrument extends _instrumentBase.InstrumentBase {
84
84
  ...this,
85
85
  mode: this.#mode,
86
86
  agentRef: this.#agentRef,
87
+ trigger,
87
88
  timeKeeper: this.#agentRef.runtime.timeKeeper
88
89
  }); // if TK exists due to deferred state, pass it
89
90
  this.recorder.startRecording();
@@ -107,7 +108,7 @@ class Instrument extends _instrumentBase.InstrumentBase {
107
108
  } else {
108
109
  // pre-load
109
110
  this.#mode = _constants.MODE.FULL;
110
- this.#preloadStartRecording();
111
+ this.#preloadStartRecording(_constants2.TRIGGERS.API);
111
112
  // There's a race here wherein either:
112
113
  // a. Recorder has not been initialized, and we've set the enforced mode, so we're good, or;
113
114
  // b. Record has been initialized, possibly with the "wrong" mode, so we have to correct that + restart.
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.296.0-rc.5";
14
+ export const VERSION = "1.296.0-rc.6";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.296.0-rc.5";
14
+ export const VERSION = "1.296.0-rc.6";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -10,7 +10,7 @@ import { handle } from '../../../common/event-emitter/handle';
10
10
  import { DEFAULT_KEY, MODE, PREFIX } from '../../../common/session/constants';
11
11
  import { InstrumentBase } from '../../utils/instrument-base';
12
12
  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';
14
14
  import { setupRecordReplayAPI } from '../../../loaders/api/recordReplay';
15
15
  import { setupPauseReplayAPI } from '../../../loaders/api/pauseReplay';
16
16
  export class Instrument extends InstrumentBase {
@@ -65,7 +65,7 @@ export class Instrument extends InstrumentBase {
65
65
  /**
66
66
  * 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.
67
67
  */
68
- async #preloadStartRecording() {
68
+ async #preloadStartRecording(trigger) {
69
69
  if (this.#alreadyStarted) return;
70
70
  this.#alreadyStarted = true;
71
71
  try {
@@ -79,6 +79,7 @@ export class Instrument extends InstrumentBase {
79
79
  ...this,
80
80
  mode: this.#mode,
81
81
  agentRef: this.#agentRef,
82
+ trigger,
82
83
  timeKeeper: this.#agentRef.runtime.timeKeeper
83
84
  }); // if TK exists due to deferred state, pass it
84
85
  this.recorder.startRecording();
@@ -102,7 +103,7 @@ export class Instrument extends InstrumentBase {
102
103
  } else {
103
104
  // pre-load
104
105
  this.#mode = MODE.FULL;
105
- this.#preloadStartRecording();
106
+ this.#preloadStartRecording(TRIGGERS.API);
106
107
  // There's a race here wherein either:
107
108
  // a. Recorder has not been initialized, and we've set the enforced mode, so we're good, or;
108
109
  // b. Record has been initialized, possibly with the "wrong" mode, so we have to correct that + restart.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.296.0-rc.5",
3
+ "version": "1.296.0-rc.6",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -10,7 +10,7 @@ import { handle } from '../../../common/event-emitter/handle'
10
10
  import { DEFAULT_KEY, MODE, PREFIX } from '../../../common/session/constants'
11
11
  import { InstrumentBase } from '../../utils/instrument-base'
12
12
  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'
14
14
  import { setupRecordReplayAPI } from '../../../loaders/api/recordReplay'
15
15
  import { setupPauseReplayAPI } from '../../../loaders/api/pauseReplay'
16
16
 
@@ -69,7 +69,7 @@ export class Instrument extends InstrumentBase {
69
69
  /**
70
70
  * 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.
71
71
  */
72
- async #preloadStartRecording () {
72
+ async #preloadStartRecording (trigger) {
73
73
  if (this.#alreadyStarted) return
74
74
  this.#alreadyStarted = true
75
75
 
@@ -78,7 +78,7 @@ export class Instrument extends InstrumentBase {
78
78
 
79
79
  // If startReplay() has been used by this point, we must record in full mode regardless of session preload:
80
80
  // 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
82
82
  this.recorder.startRecording()
83
83
  this.abortHandler = this.recorder.stopRecording
84
84
  } catch (err) {
@@ -95,7 +95,7 @@ export class Instrument extends InstrumentBase {
95
95
  if (this.featAggregate.mode !== MODE.FULL) this.featAggregate.initializeRecording(MODE.FULL, true)
96
96
  } else { // pre-load
97
97
  this.#mode = MODE.FULL
98
- this.#preloadStartRecording()
98
+ this.#preloadStartRecording(TRIGGERS.API)
99
99
  // There's a race here wherein either:
100
100
  // a. Recorder has not been initialized, and we've set the enforced mode, so we're good, or;
101
101
  // b. Record has been initialized, possibly with the "wrong" mode, so we have to correct that + restart.