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

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.6";
20
+ const VERSION = exports.VERSION = "1.296.0-rc.7";
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.6";
20
+ const VERSION = exports.VERSION = "1.296.0-rc.7";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -41,8 +41,9 @@ class AggregateBase extends _featureBase.FeatureBase {
41
41
  /** @type {Boolean} indicates if custom attributes are combined in each event payload for size estimation purposes. this is set to true in derived classes that need to evaluate custom attributes separately from the event payload */
42
42
  this.customAttributesAreSeparate = false;
43
43
  /** @type {Boolean} indicates if the feature can harvest early. This is set to false in derived classes that need to block early harvests, like ajax under certain conditions */
44
- this.canHarvestEarly = true; // this is set to false in derived classes that need to block early harvests, like ajax under certain conditions
45
-
44
+ this.canHarvestEarly = true;
45
+ /** @type {Boolean} indicates if the feature is actively in a retry deferral period */
46
+ this.isRetrying = false;
46
47
  this.harvestOpts = {}; // features aggregate classes can define custom opts for when their harvest is called
47
48
 
48
49
  const agentEntityGuid = this.agentRef?.runtime?.appMetadata?.agents?.[0]?.entityGuid;
@@ -90,7 +91,7 @@ class AggregateBase extends _featureBase.FeatureBase {
90
91
  * @returns void
91
92
  */
92
93
  decideEarlyHarvest() {
93
- if (!this.canHarvestEarly) return;
94
+ if (!this.canHarvestEarly || this.blocked || this.isRetrying) return;
94
95
  const estimatedSize = this.events.byteSize() + (this.customAttributesAreSeparate ? this.agentRef.runtime.jsAttributesMetadata.bytes : 0);
95
96
  if (estimatedSize > _agentConstants.IDEAL_PAYLOAD_SIZE) {
96
97
  this.agentRef.runtime.harvester.triggerHarvestFor(this);
@@ -179,8 +180,8 @@ class AggregateBase extends _featureBase.FeatureBase {
179
180
  * @param {boolean=} result.retry - whether the harvest should be retried
180
181
  */
181
182
  postHarvestCleanup(result = {}) {
182
- const harvestFailed = result.sent && result.retry;
183
- if (harvestFailed) this.events.reloadSave(this.harvestOpts, result.targetApp?.entityGuid);
183
+ this.isRetrying = result.sent && result.retry;
184
+ if (this.isRetrying) this.events.reloadSave(this.harvestOpts, result.targetApp?.entityGuid);
184
185
  this.events.clearSave(this.harvestOpts, result.targetApp?.entityGuid);
185
186
  }
186
187
 
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.296.0-rc.6";
14
+ export const VERSION = "1.296.0-rc.7";
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.6";
14
+ export const VERSION = "1.296.0-rc.7";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -34,8 +34,9 @@ export class AggregateBase extends FeatureBase {
34
34
  /** @type {Boolean} indicates if custom attributes are combined in each event payload for size estimation purposes. this is set to true in derived classes that need to evaluate custom attributes separately from the event payload */
35
35
  this.customAttributesAreSeparate = false;
36
36
  /** @type {Boolean} indicates if the feature can harvest early. This is set to false in derived classes that need to block early harvests, like ajax under certain conditions */
37
- this.canHarvestEarly = true; // this is set to false in derived classes that need to block early harvests, like ajax under certain conditions
38
-
37
+ this.canHarvestEarly = true;
38
+ /** @type {Boolean} indicates if the feature is actively in a retry deferral period */
39
+ this.isRetrying = false;
39
40
  this.harvestOpts = {}; // features aggregate classes can define custom opts for when their harvest is called
40
41
 
41
42
  const agentEntityGuid = this.agentRef?.runtime?.appMetadata?.agents?.[0]?.entityGuid;
@@ -83,7 +84,7 @@ export class AggregateBase extends FeatureBase {
83
84
  * @returns void
84
85
  */
85
86
  decideEarlyHarvest() {
86
- if (!this.canHarvestEarly) return;
87
+ if (!this.canHarvestEarly || this.blocked || this.isRetrying) return;
87
88
  const estimatedSize = this.events.byteSize() + (this.customAttributesAreSeparate ? this.agentRef.runtime.jsAttributesMetadata.bytes : 0);
88
89
  if (estimatedSize > IDEAL_PAYLOAD_SIZE) {
89
90
  this.agentRef.runtime.harvester.triggerHarvestFor(this);
@@ -172,8 +173,8 @@ export class AggregateBase extends FeatureBase {
172
173
  * @param {boolean=} result.retry - whether the harvest should be retried
173
174
  */
174
175
  postHarvestCleanup(result = {}) {
175
- const harvestFailed = result.sent && result.retry;
176
- if (harvestFailed) this.events.reloadSave(this.harvestOpts, result.targetApp?.entityGuid);
176
+ this.isRetrying = result.sent && result.retry;
177
+ if (this.isRetrying) this.events.reloadSave(this.harvestOpts, result.targetApp?.entityGuid);
177
178
  this.events.clearSave(this.harvestOpts, result.targetApp?.entityGuid);
178
179
  }
179
180
 
@@ -10,6 +10,8 @@ export class AggregateBase extends FeatureBase {
10
10
  customAttributesAreSeparate: boolean;
11
11
  /** @type {Boolean} indicates if the feature can harvest early. This is set to false in derived classes that need to block early harvests, like ajax under certain conditions */
12
12
  canHarvestEarly: boolean;
13
+ /** @type {Boolean} indicates if the feature is actively in a retry deferral period */
14
+ isRetrying: boolean;
13
15
  harvestOpts: {};
14
16
  events: any;
15
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"aggregate-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/aggregate-base.js"],"names":[],"mappings":"AAsBA;IACE;;;;OAIG;IACH,sBAHW,MAAM,eACN,MAAM,EAyBhB;IArBC,iBAAwB;IAIxB,uOAAuO;IACvO,qCAAwC;IACxC,gLAAgL;IAChL,yBAA2B;IAE3B,gBAAqB;IA4BjB,YAAwJ;IAW9J;;;;OAIG;IACH,2BAOC;IAED;;;;OAIG;IACH,yBAHW,MAAM,EAAE,gBAwBlB;IAED;;OAEG;IACH,cAGC;IADC,6BAAmB;IAGrB,qCAEC;IAED;;;;;;OAMG;IACH,uDAJW,MAAM,GAAC,SAAS,SAyB1B;IAED;;;;;;;OAOG;IACH,4BALG;QAAwB,SAAS,GAAzB,MAAM,YAAC;KACf,QAQF;IAED;;;OAGG;IACH,6CAsBC;IAED;;;OAGG;IACH,2CAOC;IALC,gBAA6C;IAO/C;;;;OAIG;IACH,uCAHW,GAAC,UACD,GAAC,QAIX;;CACF;4BA7N2B,gBAAgB"}
1
+ {"version":3,"file":"aggregate-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/aggregate-base.js"],"names":[],"mappings":"AAsBA;IACE;;;;OAIG;IACH,sBAHW,MAAM,eACN,MAAM,EA2BhB;IAvBC,iBAAwB;IAIxB,uOAAuO;IACvO,qCAAwC;IACxC,gLAAgL;IAChL,yBAA2B;IAC3B,sFAAsF;IACtF,oBAAuB;IAEvB,gBAAqB;IA4BjB,YAAwJ;IAW9J;;;;OAIG;IACH,2BAOC;IAED;;;;OAIG;IACH,yBAHW,MAAM,EAAE,gBAwBlB;IAED;;OAEG;IACH,cAGC;IADC,6BAAmB;IAGrB,qCAEC;IAED;;;;;;OAMG;IACH,uDAJW,MAAM,GAAC,SAAS,SAyB1B;IAED;;;;;;;OAOG;IACH,4BALG;QAAwB,SAAS,GAAzB,MAAM,YAAC;KACf,QAQF;IAED;;;OAGG;IACH,6CAsBC;IAED;;;OAGG;IACH,2CAOC;IALC,gBAA6C;IAO/C;;;;OAIG;IACH,uCAHW,GAAC,UACD,GAAC,QAIX;;CACF;4BA/N2B,gBAAgB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.296.0-rc.6",
3
+ "version": "1.296.0-rc.7",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -35,7 +35,9 @@ export class AggregateBase extends FeatureBase {
35
35
  /** @type {Boolean} indicates if custom attributes are combined in each event payload for size estimation purposes. this is set to true in derived classes that need to evaluate custom attributes separately from the event payload */
36
36
  this.customAttributesAreSeparate = false
37
37
  /** @type {Boolean} indicates if the feature can harvest early. This is set to false in derived classes that need to block early harvests, like ajax under certain conditions */
38
- this.canHarvestEarly = true // this is set to false in derived classes that need to block early harvests, like ajax under certain conditions
38
+ this.canHarvestEarly = true
39
+ /** @type {Boolean} indicates if the feature is actively in a retry deferral period */
40
+ this.isRetrying = false
39
41
 
40
42
  this.harvestOpts = {} // features aggregate classes can define custom opts for when their harvest is called
41
43
 
@@ -82,7 +84,7 @@ export class AggregateBase extends FeatureBase {
82
84
  * @returns void
83
85
  */
84
86
  decideEarlyHarvest () {
85
- if (!this.canHarvestEarly) return
87
+ if (!this.canHarvestEarly || this.blocked || this.isRetrying) return
86
88
  const estimatedSize = this.events.byteSize() + (this.customAttributesAreSeparate ? this.agentRef.runtime.jsAttributesMetadata.bytes : 0)
87
89
  if (estimatedSize > IDEAL_PAYLOAD_SIZE) {
88
90
  this.agentRef.runtime.harvester.triggerHarvestFor(this)
@@ -169,8 +171,8 @@ export class AggregateBase extends FeatureBase {
169
171
  * @param {boolean=} result.retry - whether the harvest should be retried
170
172
  */
171
173
  postHarvestCleanup (result = {}) {
172
- const harvestFailed = result.sent && result.retry
173
- if (harvestFailed) this.events.reloadSave(this.harvestOpts, result.targetApp?.entityGuid)
174
+ this.isRetrying = result.sent && result.retry
175
+ if (this.isRetrying) this.events.reloadSave(this.harvestOpts, result.targetApp?.entityGuid)
174
176
  this.events.clearSave(this.harvestOpts, result.targetApp?.entityGuid)
175
177
  }
176
178