@newrelic/browser-agent 1.296.0-rc.6 → 1.296.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.
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/features/utils/aggregate-base.js +6 -5
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/features/utils/aggregate-base.js +6 -5
- package/dist/types/features/utils/aggregate-base.d.ts +2 -0
- package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/utils/aggregate-base.js +6 -4
|
@@ -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.
|
|
20
|
+
const VERSION = exports.VERSION = "1.296.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.296.0-rc.
|
|
20
|
+
const VERSION = exports.VERSION = "1.296.0-rc.8";
|
|
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;
|
|
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
|
-
|
|
183
|
-
if (
|
|
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
|
|
|
@@ -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;
|
|
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
|
-
|
|
176
|
-
if (
|
|
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,
|
|
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
|
@@ -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
|
|
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
|
-
|
|
173
|
-
if (
|
|
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
|
|