@newrelic/browser-agent 1.298.0-rc.6 → 1.298.0-rc.8

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.298.0-rc.6";
20
+ const VERSION = exports.VERSION = "1.298.0-rc.8";
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.298.0-rc.6";
20
+ const VERSION = exports.VERSION = "1.298.0-rc.8";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -142,7 +142,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
142
142
  sessionReplayMode: this.mode
143
143
  });
144
144
  } else {
145
- this.initializeRecording(_constants2.MODE.FULL, true);
145
+ this.initializeRecording(_constants2.MODE.FULL, true, _constants.TRIGGERS.SWITCH_TO_FULL);
146
146
  }
147
147
  }
148
148
 
@@ -59,9 +59,13 @@ class Recorder {
59
59
  this.#canRecord = false;
60
60
  this.stopRecording();
61
61
  }, this.srFeatureName, this.ee);
62
- (0, _registerHandler.registerHandler)(RRWEB_DATA_CHANNEL, (event, isCheckout) => {
62
+
63
+ /** If Agg is already drained before importing the recorder (likely deferred API call pattern),
64
+ * registerHandler wont do anything. Just set up the on listener directly */
65
+ const processReplayNode = (event, isCheckout) => {
63
66
  this.audit(event, isCheckout);
64
- }, this.srFeatureName, this.ee);
67
+ };
68
+ if (this.srInstrument.featAggregate?.drained) this.ee.on(RRWEB_DATA_CHANNEL, processReplayNode);else (0, _registerHandler.registerHandler)(RRWEB_DATA_CHANNEL, processReplayNode, this.srFeatureName, this.ee);
65
69
  }
66
70
  get trigger() {
67
71
  return this.triggerHistory[this.triggerHistory.length - 1];
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.298.0-rc.6";
14
+ export const VERSION = "1.298.0-rc.8";
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.298.0-rc.6";
14
+ export const VERSION = "1.298.0-rc.8";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -137,7 +137,7 @@ export class Aggregate extends AggregateBase {
137
137
  sessionReplayMode: this.mode
138
138
  });
139
139
  } else {
140
- this.initializeRecording(MODE.FULL, true);
140
+ this.initializeRecording(MODE.FULL, true, TRIGGERS.SWITCH_TO_FULL);
141
141
  }
142
142
  }
143
143
 
@@ -52,9 +52,13 @@ export class Recorder {
52
52
  this.#canRecord = false;
53
53
  this.stopRecording();
54
54
  }, this.srFeatureName, this.ee);
55
- registerHandler(RRWEB_DATA_CHANNEL, (event, isCheckout) => {
55
+
56
+ /** If Agg is already drained before importing the recorder (likely deferred API call pattern),
57
+ * registerHandler wont do anything. Just set up the on listener directly */
58
+ const processReplayNode = (event, isCheckout) => {
56
59
  this.audit(event, isCheckout);
57
- }, this.srFeatureName, this.ee);
60
+ };
61
+ if (this.srInstrument.featAggregate?.drained) this.ee.on(RRWEB_DATA_CHANNEL, processReplayNode);else registerHandler(RRWEB_DATA_CHANNEL, processReplayNode, this.srFeatureName, this.ee);
58
62
  }
59
63
  get trigger() {
60
64
  return this.triggerHistory[this.triggerHistory.length - 1];
@@ -1 +1 @@
1
- {"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/recorder.js"],"names":[],"mappings":"AAqBA;IAUE,+BA6BC;IA/BD,sBAAmB;IAGjB,iDAAiD;IACjD,kBAAgC;IAEhC,QAAyB;IACzB,mBAA6C;IAC7C,cAAqC;IAErC,qBAAwB;IACxB,0FAA0F;IAC1F,eAAkE;IAElE,iHAAiH;IACjH,uBAAgD;IAChD,mFAAmF;IACnF,iCAA0D;IAC1D,uIAAuI;IACvI,yBAA4B;IAC5B,kIAAkI;IAClI,kBAAqB;IACrB,uIAAuI;IACvI,0BAAwE;IAU1E,mBAEC;IAED;;;;;;;;;MAWC;IAED,kFAAkF;IAClF,oBAGC;IAED,qDAAqD;IACrD,8CAyCC;IAED;;;;;OAKG;IACH,aAHW,GAAC,cACD,GAAC,QAiCX;IAED,yHAAyH;IACzH,yCAgCC;IAED,0HAA0H;IAC1H,yBAOC;IAED,wBAEC;IAED,gCAAgC;IAChC,uCAGC;IAED;;;SAGK;IACL,oCAGC;;CACF;+BAhO8B,mBAAmB"}
1
+ {"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/recorder.js"],"names":[],"mappings":"AAqBA;IAUE,+BAiCC;IAnCD,sBAAmB;IAGjB,iDAAiD;IACjD,kBAAgC;IAEhC,QAAyB;IACzB,mBAA6C;IAC7C,cAAqC;IAErC,qBAAwB;IACxB,0FAA0F;IAC1F,eAAkE;IAElE,iHAAiH;IACjH,uBAAgD;IAChD,mFAAmF;IACnF,iCAA0D;IAC1D,uIAAuI;IACvI,yBAA4B;IAC5B,kIAAkI;IAClI,kBAAqB;IACrB,uIAAuI;IACvI,0BAAwE;IAc1E,mBAEC;IAED;;;;;;;;;MAWC;IAED,kFAAkF;IAClF,oBAGC;IAED,qDAAqD;IACrD,8CAyCC;IAED;;;;;OAKG;IACH,aAHW,GAAC,cACD,GAAC,QAiCX;IAED,yHAAyH;IACzH,yCAgCC;IAED,0HAA0H;IAC1H,yBAOC;IAED,wBAEC;IAED,gCAAgC;IAChC,uCAGC;IAED;;;SAGK;IACL,oCAGC;;CACF;+BApO8B,mBAAmB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.298.0-rc.6",
3
+ "version": "1.298.0-rc.8",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -136,7 +136,7 @@ export class Aggregate extends AggregateBase {
136
136
  if (!this.agentRef.runtime.isRecording) this.recorder.startRecording(TRIGGERS.SWITCH_TO_FULL, this.mode) // off --> full
137
137
  this.syncWithSessionManager({ sessionReplayMode: this.mode })
138
138
  } else {
139
- this.initializeRecording(MODE.FULL, true)
139
+ this.initializeRecording(MODE.FULL, true, TRIGGERS.SWITCH_TO_FULL)
140
140
  }
141
141
  }
142
142
 
@@ -57,7 +57,11 @@ export class Recorder {
57
57
  this.stopRecording()
58
58
  }, this.srFeatureName, this.ee)
59
59
 
60
- registerHandler(RRWEB_DATA_CHANNEL, (event, isCheckout) => { this.audit(event, isCheckout) }, this.srFeatureName, this.ee)
60
+ /** If Agg is already drained before importing the recorder (likely deferred API call pattern),
61
+ * registerHandler wont do anything. Just set up the on listener directly */
62
+ const processReplayNode = (event, isCheckout) => { this.audit(event, isCheckout) }
63
+ if (this.srInstrument.featAggregate?.drained) this.ee.on(RRWEB_DATA_CHANNEL, processReplayNode)
64
+ else registerHandler(RRWEB_DATA_CHANNEL, processReplayNode, this.srFeatureName, this.ee)
61
65
  }
62
66
 
63
67
  get trigger () {