@atlaskit/react-ufo 4.10.1 → 4.11.0
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/CHANGELOG.md +16 -0
- package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +10 -7
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +13 -9
- package/dist/cjs/interaction-metrics/index.js +6 -4
- package/dist/cjs/interaction-metrics/post-interaction-log.js +13 -6
- package/dist/cjs/vc/index.js +4 -1
- package/dist/cjs/vc/vc-observer-new/index.js +10 -4
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +11 -18
- package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +5 -2
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +5 -2
- package/dist/es2019/interaction-metrics/index.js +6 -4
- package/dist/es2019/interaction-metrics/post-interaction-log.js +7 -1
- package/dist/es2019/vc/index.js +4 -1
- package/dist/es2019/vc/vc-observer-new/index.js +11 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +10 -15
- package/dist/esm/create-experimental-interaction-metrics-payload/index.js +10 -7
- package/dist/esm/create-payload/utils/get-vc-metrics.js +13 -9
- package/dist/esm/interaction-metrics/index.js +6 -4
- package/dist/esm/interaction-metrics/post-interaction-log.js +13 -6
- package/dist/esm/vc/index.js +4 -1
- package/dist/esm/vc/vc-observer-new/index.js +10 -4
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +11 -18
- package/dist/types/common/common/types.d.ts +1 -0
- package/dist/types/create-interaction-extra-metrics-payload/index.d.ts +1 -0
- package/dist/types/create-payload/index.d.ts +384 -0
- package/dist/types/interaction-metrics/index.d.ts +2 -2
- package/dist/types/vc/types.d.ts +4 -0
- package/dist/types/vc/vc-observer/getVCRevisionDebugDetails.d.ts +2 -0
- package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/types.d.ts +4 -0
- package/dist/types/vc/vc-observer-new/types.d.ts +4 -0
- package/dist/types-ts4.5/common/common/types.d.ts +1 -0
- package/dist/types-ts4.5/create-interaction-extra-metrics-payload/index.d.ts +1 -0
- package/dist/types-ts4.5/create-payload/index.d.ts +384 -0
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/types.d.ts +4 -0
- package/dist/types-ts4.5/vc/vc-observer/getVCRevisionDebugDetails.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/types.d.ts +4 -0
- package/dist/types-ts4.5/vc/vc-observer-new/types.d.ts +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`53cdd8bde9bff`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/53cdd8bde9bff) -
|
|
8
|
+
add optional errorStatusCode param to ufo's addError() and addErrorToAll() api
|
|
9
|
+
|
|
10
|
+
## 4.10.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`4b8df6fc79b12`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4b8df6fc79b12) -
|
|
15
|
+
Add interactionType to VC debugData
|
|
16
|
+
- [`4b8df6fc79b12`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4b8df6fc79b12) -
|
|
17
|
+
bugfixes on VC debug data
|
|
18
|
+
|
|
3
19
|
## 4.10.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -95,18 +95,19 @@ function getExperimentalVCMetrics(_x) {
|
|
|
95
95
|
}
|
|
96
96
|
function _getExperimentalVCMetrics() {
|
|
97
97
|
_getExperimentalVCMetrics = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interaction) {
|
|
98
|
-
var vcObserver, _interaction$apdex, prefix, result, VC
|
|
98
|
+
var vcObserver, pageVisibilityUpToTTAI, _interaction$apdex, prefix, result, VC;
|
|
99
99
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
100
100
|
while (1) switch (_context.prev = _context.next) {
|
|
101
101
|
case 0:
|
|
102
102
|
// Use per-interaction VC observer if available, otherwise fall back to global experimentalVC
|
|
103
103
|
vcObserver = interaction.experimentalVCObserver || experimentalVC.vcObserver;
|
|
104
|
+
pageVisibilityUpToTTAI = (0, _hiddenTiming.getPageVisibilityState)(interaction.start, interaction.end);
|
|
104
105
|
if (!vcObserver) {
|
|
105
106
|
_context.next = 13;
|
|
106
107
|
break;
|
|
107
108
|
}
|
|
108
109
|
prefix = 'ufo-experimental';
|
|
109
|
-
_context.next =
|
|
110
|
+
_context.next = 6;
|
|
110
111
|
return vcObserver.getVCResult({
|
|
111
112
|
start: interaction.start,
|
|
112
113
|
stop: interaction.end,
|
|
@@ -115,18 +116,20 @@ function _getExperimentalVCMetrics() {
|
|
|
115
116
|
prefix: prefix,
|
|
116
117
|
vc: interaction.vc,
|
|
117
118
|
experienceKey: interaction.ufoName,
|
|
118
|
-
interactionId: interaction.id
|
|
119
|
+
interactionId: interaction.id,
|
|
120
|
+
interactionType: interaction.type,
|
|
121
|
+
isPageVisible: pageVisibilityUpToTTAI === 'visible',
|
|
122
|
+
interactionAbortReason: interaction.abortReason
|
|
119
123
|
});
|
|
120
|
-
case
|
|
124
|
+
case 6:
|
|
121
125
|
result = _context.sent;
|
|
122
126
|
VC = result === null || result === void 0 ? void 0 : result['metrics:vc'];
|
|
123
127
|
if (!(!VC || !(result !== null && result !== void 0 && result["".concat(prefix, ":vc:clean")]))) {
|
|
124
|
-
_context.next =
|
|
128
|
+
_context.next = 10;
|
|
125
129
|
break;
|
|
126
130
|
}
|
|
127
131
|
return _context.abrupt("return", result);
|
|
128
|
-
case
|
|
129
|
-
pageVisibilityUpToTTAI = (0, _hiddenTiming.getPageVisibilityState)(interaction.start, interaction.end);
|
|
132
|
+
case 10:
|
|
130
133
|
if (!(interaction.abortReason || pageVisibilityUpToTTAI !== 'visible')) {
|
|
131
134
|
_context.next = 12;
|
|
132
135
|
break;
|
|
@@ -26,6 +26,7 @@ function _getVCMetrics() {
|
|
|
26
26
|
config,
|
|
27
27
|
interactionStatus,
|
|
28
28
|
pageVisibilityUpToTTAI,
|
|
29
|
+
isPageVisible,
|
|
29
30
|
shouldReportVCMetrics,
|
|
30
31
|
observer,
|
|
31
32
|
isSSREnabled,
|
|
@@ -56,14 +57,15 @@ function _getVCMetrics() {
|
|
|
56
57
|
case 7:
|
|
57
58
|
interactionStatus = (0, _getInteractionStatus.default)(interaction);
|
|
58
59
|
pageVisibilityUpToTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
59
|
-
|
|
60
|
+
isPageVisible = pageVisibilityUpToTTAI === 'visible';
|
|
61
|
+
shouldReportVCMetrics = interactionStatus.originalInteractionStatus === 'SUCCEEDED' && isPageVisible; // Use per-interaction VC observer if available, otherwise fall back to global
|
|
60
62
|
observer = interaction.vcObserver;
|
|
61
63
|
if (observer) {
|
|
62
|
-
_context.next =
|
|
64
|
+
_context.next = 14;
|
|
63
65
|
break;
|
|
64
66
|
}
|
|
65
67
|
return _context.abrupt("return", {});
|
|
66
|
-
case
|
|
68
|
+
case 14:
|
|
67
69
|
isSSREnabled = interaction.type === 'page_load' && ((config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName)));
|
|
68
70
|
ssr = interaction.type === 'page_load' && isSSREnabled ? {
|
|
69
71
|
ssr: (0, _getSsrDoneTimeValue.default)(config)
|
|
@@ -71,7 +73,7 @@ function _getVCMetrics() {
|
|
|
71
73
|
_interactionMetrics.postInteractionLog.setVCObserverSSRConfig(ssr);
|
|
72
74
|
tti = (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime;
|
|
73
75
|
prefix = 'ufo';
|
|
74
|
-
_context.next =
|
|
76
|
+
_context.next = 21;
|
|
75
77
|
return observer.getVCResult(_objectSpread(_objectSpread({
|
|
76
78
|
start: interaction.start,
|
|
77
79
|
stop: interaction.end,
|
|
@@ -85,9 +87,11 @@ function _getVCMetrics() {
|
|
|
85
87
|
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio
|
|
86
88
|
}, ssr), {}, {
|
|
87
89
|
include3p: include3p,
|
|
88
|
-
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch
|
|
90
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
91
|
+
interactionType: interaction.type,
|
|
92
|
+
isPageVisible: isPageVisible
|
|
89
93
|
}));
|
|
90
|
-
case
|
|
94
|
+
case 21:
|
|
91
95
|
result = _context.sent;
|
|
92
96
|
observer.stop(interaction.ufoName);
|
|
93
97
|
if (!include3p) {
|
|
@@ -100,15 +104,15 @@ function _getVCMetrics() {
|
|
|
100
104
|
return revision === mostRecentVCRevision;
|
|
101
105
|
});
|
|
102
106
|
if (!(!shouldReportVCMetrics || !(mostRecentVCRevisionPayload !== null && mostRecentVCRevisionPayload !== void 0 && mostRecentVCRevisionPayload.clean))) {
|
|
103
|
-
_context.next =
|
|
107
|
+
_context.next = 28;
|
|
104
108
|
break;
|
|
105
109
|
}
|
|
106
110
|
return _context.abrupt("return", result);
|
|
107
|
-
case
|
|
111
|
+
case 28:
|
|
108
112
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
109
113
|
'metric:vc90': mostRecentVCRevisionPayload['metric:vc90']
|
|
110
114
|
}));
|
|
111
|
-
case
|
|
115
|
+
case 29:
|
|
112
116
|
case "end":
|
|
113
117
|
return _context.stop();
|
|
114
118
|
}
|
|
@@ -588,7 +588,7 @@ var ModuleLoadingProfiler = exports.ModuleLoadingProfiler = {
|
|
|
588
588
|
removeHoldByID(currentInteractionId, id);
|
|
589
589
|
}
|
|
590
590
|
};
|
|
591
|
-
function addError(interactionId, name, labelStack, errorType, errorMessage, errorStack, forcedError, errorHash) {
|
|
591
|
+
function addError(interactionId, name, labelStack, errorType, errorMessage, errorStack, forcedError, errorHash, errorStatusCode) {
|
|
592
592
|
var interaction = _constants.interactions.get(interactionId);
|
|
593
593
|
if (interaction != null) {
|
|
594
594
|
interaction.errors.push({
|
|
@@ -598,11 +598,12 @@ function addError(interactionId, name, labelStack, errorType, errorMessage, erro
|
|
|
598
598
|
errorMessage: errorMessage,
|
|
599
599
|
errorStack: errorStack,
|
|
600
600
|
forcedError: forcedError,
|
|
601
|
-
errorHash: errorHash
|
|
601
|
+
errorHash: errorHash,
|
|
602
|
+
errorStatusCode: errorStatusCode
|
|
602
603
|
});
|
|
603
604
|
}
|
|
604
605
|
}
|
|
605
|
-
function addErrorToAll(name, labelStack, errorType, errorMessage, errorStack, errorHash) {
|
|
606
|
+
function addErrorToAll(name, labelStack, errorType, errorMessage, errorStack, errorHash, errorStatusCode) {
|
|
606
607
|
_constants.interactions.forEach(function (interaction) {
|
|
607
608
|
interaction.errors.push({
|
|
608
609
|
name: name,
|
|
@@ -610,7 +611,8 @@ function addErrorToAll(name, labelStack, errorType, errorMessage, errorStack, er
|
|
|
610
611
|
errorType: errorType,
|
|
611
612
|
errorMessage: errorMessage,
|
|
612
613
|
errorStack: errorStack,
|
|
613
|
-
errorHash: errorHash
|
|
614
|
+
errorHash: errorHash,
|
|
615
|
+
errorStatusCode: errorStatusCode
|
|
614
616
|
});
|
|
615
617
|
});
|
|
616
618
|
}
|
|
@@ -12,6 +12,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
14
|
var _config = require("../config");
|
|
15
|
+
var _hiddenTiming = require("../hidden-timing");
|
|
15
16
|
var _vc = require("../vc");
|
|
16
17
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -122,7 +123,7 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
|
|
|
122
123
|
value: (function () {
|
|
123
124
|
var _sendPostInteractionLog = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
124
125
|
var _this$vcObserver4, _config$vc, _config$vc2, _this$vcObserver5;
|
|
125
|
-
var _this$vcObserver3, config, postInteractionFinishVCResult;
|
|
126
|
+
var _this$vcObserver3, pageVisibilityState, isPageVisible, config, postInteractionFinishVCResult;
|
|
126
127
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
127
128
|
while (1) switch (_context.prev = _context.next) {
|
|
128
129
|
case 0:
|
|
@@ -134,9 +135,11 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
|
|
|
134
135
|
(_this$vcObserver3 = this.vcObserver) === null || _this$vcObserver3 === void 0 || _this$vcObserver3.stop();
|
|
135
136
|
return _context.abrupt("return");
|
|
136
137
|
case 4:
|
|
138
|
+
pageVisibilityState = (0, _hiddenTiming.getPageVisibilityState)(this.lastInteractionFinish.start, this.lastInteractionFinish.end);
|
|
139
|
+
isPageVisible = pageVisibilityState === 'visible';
|
|
137
140
|
config = (0, _config.getConfig)();
|
|
138
|
-
_context.next =
|
|
139
|
-
return (_this$vcObserver4 = this.vcObserver) === null || _this$vcObserver4 === void 0 ? void 0 : _this$vcObserver4.getVCResult(_objectSpread({
|
|
141
|
+
_context.next = 9;
|
|
142
|
+
return (_this$vcObserver4 = this.vcObserver) === null || _this$vcObserver4 === void 0 ? void 0 : _this$vcObserver4.getVCResult(_objectSpread(_objectSpread({
|
|
140
143
|
start: this.lastInteractionFinish.start,
|
|
141
144
|
stop: performance.now(),
|
|
142
145
|
tti: -1,
|
|
@@ -147,8 +150,12 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
|
|
|
147
150
|
interactionId: this.lastInteractionFinish.id,
|
|
148
151
|
includeSSRInV3: config === null || config === void 0 || (_config$vc = config.vc) === null || _config$vc === void 0 ? void 0 : _config$vc.includeSSRInV3,
|
|
149
152
|
includeSSRRatio: config === null || config === void 0 || (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRRatio
|
|
150
|
-
}, this.vcObserverSSRConfig)
|
|
151
|
-
|
|
153
|
+
}, this.vcObserverSSRConfig), {}, {
|
|
154
|
+
interactionType: this.lastInteractionFinish.type,
|
|
155
|
+
isPageVisible: isPageVisible,
|
|
156
|
+
interactionAbortReason: this.lastInteractionFinish.abortReason
|
|
157
|
+
}));
|
|
158
|
+
case 9:
|
|
152
159
|
postInteractionFinishVCResult = _context.sent;
|
|
153
160
|
(_this$vcObserver5 = this.vcObserver) === null || _this$vcObserver5 === void 0 || _this$vcObserver5.stop();
|
|
154
161
|
this.sinkHandlerFn({
|
|
@@ -158,7 +165,7 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
|
|
|
158
165
|
lastInteractionFinishVCResult: this.lastInteractionFinishVCResult
|
|
159
166
|
});
|
|
160
167
|
this.reset();
|
|
161
|
-
case
|
|
168
|
+
case 13:
|
|
162
169
|
case "end":
|
|
163
170
|
return _context.stop();
|
|
164
171
|
}
|
package/dist/cjs/vc/index.js
CHANGED
|
@@ -152,7 +152,10 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
152
152
|
interactionId: param.interactionId,
|
|
153
153
|
ssr: param.includeSSRInV3 ? param.ssr : undefined,
|
|
154
154
|
include3p: include3p,
|
|
155
|
-
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch
|
|
155
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
156
|
+
interactionType: param.interactionType,
|
|
157
|
+
isPageVisible: param.isPageVisible,
|
|
158
|
+
interactionAbortReason: param.interactionAbortReason
|
|
156
159
|
});
|
|
157
160
|
case 12:
|
|
158
161
|
_context.t1 = _context.sent;
|
|
@@ -238,11 +238,11 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
238
238
|
key: "getVCResult",
|
|
239
239
|
value: function () {
|
|
240
240
|
var _getVCResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
|
|
241
|
-
var start, stop, interactionId, include3p, excludeSmartAnswersInSearch, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
241
|
+
var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, excludeSmartAnswersInSearch, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
242
242
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
243
243
|
while (1) switch (_context.prev = _context.next) {
|
|
244
244
|
case 0:
|
|
245
|
-
start = param.start, stop = param.stop, interactionId = param.interactionId, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
245
|
+
start = param.start, stop = param.stop, interactionId = param.interactionId, interactionType = param.interactionType, interactionAbortReason = param.interactionAbortReason, isPageVisible = param.isPageVisible, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
246
246
|
results = [];
|
|
247
247
|
this.addStartEntry(start);
|
|
248
248
|
calculator_fy25_03 = new _fy25_.default();
|
|
@@ -259,9 +259,12 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
259
259
|
startTime: start,
|
|
260
260
|
stopTime: stop,
|
|
261
261
|
interactionId: interactionId,
|
|
262
|
+
interactionType: interactionType,
|
|
262
263
|
isPostInteraction: this.isPostInteraction,
|
|
263
264
|
include3p: include3p,
|
|
264
|
-
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch
|
|
265
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
266
|
+
isPageVisible: isPageVisible,
|
|
267
|
+
interactionAbortReason: interactionAbortReason
|
|
265
268
|
});
|
|
266
269
|
case 8:
|
|
267
270
|
fy25_03 = _context.sent;
|
|
@@ -281,8 +284,11 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
281
284
|
startTime: start,
|
|
282
285
|
stopTime: stop,
|
|
283
286
|
interactionId: interactionId,
|
|
287
|
+
interactionType: interactionType,
|
|
284
288
|
isPostInteraction: this.isPostInteraction,
|
|
285
|
-
include3p: include3p
|
|
289
|
+
include3p: include3p,
|
|
290
|
+
isPageVisible: isPageVisible,
|
|
291
|
+
interactionAbortReason: interactionAbortReason
|
|
286
292
|
});
|
|
287
293
|
case 14:
|
|
288
294
|
vcNext = _context.sent;
|
|
@@ -13,9 +13,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
14
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
-
var _getPageVisibilityUpToTtai = _interopRequireDefault(require("../../../create-payload/utils/get-page-visibility-up-to-ttai"));
|
|
17
|
-
var _interactionIdContext = require("../../../interaction-id-context");
|
|
18
|
-
var _constants = require("../../../interaction-metrics/common/constants");
|
|
19
16
|
var _trackDisplayContentOccurrence = require("../viewport-observer/utils/track-display-content-occurrence");
|
|
20
17
|
var _percentileCalc = require("./percentile-calc");
|
|
21
18
|
var _getViewportHeight = _interopRequireDefault(require("./utils/get-viewport-height"));
|
|
@@ -111,9 +108,9 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
111
108
|
}, {
|
|
112
109
|
key: "calculateWithDebugInfo",
|
|
113
110
|
value: function () {
|
|
114
|
-
var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch) {
|
|
111
|
+
var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason) {
|
|
115
112
|
var _window, _window2, _window6, _window8;
|
|
116
|
-
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, _window3, _window4, _window5, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails,
|
|
113
|
+
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, _window3, _window4, _window5, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window7, _window7$__ufo_devtoo, _window9, _window9$__on_ufo_vc_;
|
|
117
114
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
118
115
|
while (1) switch (_context.prev = _context.next) {
|
|
119
116
|
case 0:
|
|
@@ -314,17 +311,13 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
314
311
|
v3RevisionDebugDetails = null;
|
|
315
312
|
if (shouldCalculateDebugDetails) {
|
|
316
313
|
if ((0, _platformFeatureFlags.fg)('platform_ufo_unify_abort_status_in_ttvc_debug_data')) {
|
|
317
|
-
// NOTE: using this instead of directly calling `getActiveInteraction()` to get around circular dependencies
|
|
318
|
-
activeInteractionId = (0, _interactionIdContext.getInteractionId)();
|
|
319
|
-
activeInteraction = _constants.interactions.get((_activeInteractionId$ = activeInteractionId.current) !== null && _activeInteractionId$ !== void 0 ? _activeInteractionId$ : '');
|
|
320
|
-
pageVisibilityUpToTTAI = activeInteraction ? (0, _getPageVisibilityUpToTtai.default)(activeInteraction) : null;
|
|
321
|
-
isBackgrounded = pageVisibilityUpToTTAI !== 'visible';
|
|
322
314
|
v3RevisionDebugDetails = {
|
|
323
315
|
revision: this.revisionNo,
|
|
324
|
-
isClean: isVCClean && !
|
|
325
|
-
abortReason:
|
|
316
|
+
isClean: isVCClean && !interactionAbortReason && isPageVisible,
|
|
317
|
+
abortReason: !isPageVisible ? 'browser_backgrounded' : dirtyReason !== null && dirtyReason !== void 0 ? dirtyReason : interactionAbortReason,
|
|
326
318
|
vcLogs: enhancedVcLogs,
|
|
327
|
-
interactionId: interactionId
|
|
319
|
+
interactionId: interactionId,
|
|
320
|
+
interactionType: interactionType
|
|
328
321
|
};
|
|
329
322
|
} else {
|
|
330
323
|
v3RevisionDebugDetails = {
|
|
@@ -371,7 +364,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
371
364
|
}
|
|
372
365
|
}, _callee, this, [[10, 22, 25, 28]]);
|
|
373
366
|
}));
|
|
374
|
-
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0) {
|
|
367
|
+
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0, _x1, _x10, _x11) {
|
|
375
368
|
return _calculateWithDebugInfo.apply(this, arguments);
|
|
376
369
|
}
|
|
377
370
|
return calculateWithDebugInfo;
|
|
@@ -383,11 +376,11 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
383
376
|
var _this = this,
|
|
384
377
|
_vcDetails$90$t,
|
|
385
378
|
_vcDetails$;
|
|
386
|
-
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
379
|
+
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, interactionType, isPageVisible, interactionAbortReason, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
387
380
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
388
381
|
while (1) switch (_context2.prev = _context2.next) {
|
|
389
382
|
case 0:
|
|
390
|
-
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p, excludeSmartAnswersInSearch = _ref.excludeSmartAnswersInSearch;
|
|
383
|
+
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p, excludeSmartAnswersInSearch = _ref.excludeSmartAnswersInSearch, interactionType = _ref.interactionType, isPageVisible = _ref.isPageVisible, interactionAbortReason = _ref.interactionAbortReason;
|
|
391
384
|
filteredEntries = orderedEntries.filter(function (entry) {
|
|
392
385
|
return _this.isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch);
|
|
393
386
|
});
|
|
@@ -407,7 +400,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
407
400
|
});
|
|
408
401
|
case 7:
|
|
409
402
|
_context2.next = 9;
|
|
410
|
-
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch);
|
|
403
|
+
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason);
|
|
411
404
|
case 9:
|
|
412
405
|
vcDetails = _context2.sent;
|
|
413
406
|
result = {
|
|
@@ -430,7 +423,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
430
423
|
}
|
|
431
424
|
}, _callee2, this);
|
|
432
425
|
}));
|
|
433
|
-
function calculate(
|
|
426
|
+
function calculate(_x12) {
|
|
434
427
|
return _calculate.apply(this, arguments);
|
|
435
428
|
}
|
|
436
429
|
return calculate;
|
|
@@ -60,6 +60,7 @@ export const experimentalVC = new ExperimentalVCMetrics();
|
|
|
60
60
|
export async function getExperimentalVCMetrics(interaction) {
|
|
61
61
|
// Use per-interaction VC observer if available, otherwise fall back to global experimentalVC
|
|
62
62
|
const vcObserver = interaction.experimentalVCObserver || experimentalVC.vcObserver;
|
|
63
|
+
const pageVisibilityUpToTTAI = getPageVisibilityState(interaction.start, interaction.end);
|
|
63
64
|
if (vcObserver) {
|
|
64
65
|
var _interaction$apdex, _interaction$apdex$;
|
|
65
66
|
const prefix = 'ufo-experimental';
|
|
@@ -71,13 +72,15 @@ export async function getExperimentalVCMetrics(interaction) {
|
|
|
71
72
|
prefix,
|
|
72
73
|
vc: interaction.vc,
|
|
73
74
|
experienceKey: interaction.ufoName,
|
|
74
|
-
interactionId: interaction.id
|
|
75
|
+
interactionId: interaction.id,
|
|
76
|
+
interactionType: interaction.type,
|
|
77
|
+
isPageVisible: pageVisibilityUpToTTAI === 'visible',
|
|
78
|
+
interactionAbortReason: interaction.abortReason
|
|
75
79
|
});
|
|
76
80
|
const VC = result === null || result === void 0 ? void 0 : result['metrics:vc'];
|
|
77
81
|
if (!VC || !(result !== null && result !== void 0 && result[`${prefix}:vc:clean`])) {
|
|
78
82
|
return result;
|
|
79
83
|
}
|
|
80
|
-
const pageVisibilityUpToTTAI = getPageVisibilityState(interaction.start, interaction.end);
|
|
81
84
|
if (interaction.abortReason || pageVisibilityUpToTTAI !== 'visible') {
|
|
82
85
|
return result;
|
|
83
86
|
}
|
|
@@ -14,7 +14,8 @@ async function getVCMetrics(interaction, include3p = false, excludeSmartAnswersI
|
|
|
14
14
|
}
|
|
15
15
|
const interactionStatus = getInteractionStatus(interaction);
|
|
16
16
|
const pageVisibilityUpToTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
17
|
-
const
|
|
17
|
+
const isPageVisible = pageVisibilityUpToTTAI === 'visible';
|
|
18
|
+
const shouldReportVCMetrics = interactionStatus.originalInteractionStatus === 'SUCCEEDED' && isPageVisible;
|
|
18
19
|
|
|
19
20
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
20
21
|
const observer = interaction.vcObserver;
|
|
@@ -41,7 +42,9 @@ async function getVCMetrics(interaction, include3p = false, excludeSmartAnswersI
|
|
|
41
42
|
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio,
|
|
42
43
|
...ssr,
|
|
43
44
|
include3p,
|
|
44
|
-
excludeSmartAnswersInSearch
|
|
45
|
+
excludeSmartAnswersInSearch,
|
|
46
|
+
interactionType: interaction.type,
|
|
47
|
+
isPageVisible
|
|
45
48
|
});
|
|
46
49
|
observer.stop(interaction.ufoName);
|
|
47
50
|
if (!include3p) {
|
|
@@ -507,7 +507,7 @@ export const ModuleLoadingProfiler = {
|
|
|
507
507
|
removeHoldByID(currentInteractionId, id);
|
|
508
508
|
}
|
|
509
509
|
};
|
|
510
|
-
export function addError(interactionId, name, labelStack, errorType, errorMessage, errorStack, forcedError, errorHash) {
|
|
510
|
+
export function addError(interactionId, name, labelStack, errorType, errorMessage, errorStack, forcedError, errorHash, errorStatusCode) {
|
|
511
511
|
const interaction = interactions.get(interactionId);
|
|
512
512
|
if (interaction != null) {
|
|
513
513
|
interaction.errors.push({
|
|
@@ -517,11 +517,12 @@ export function addError(interactionId, name, labelStack, errorType, errorMessag
|
|
|
517
517
|
errorMessage,
|
|
518
518
|
errorStack,
|
|
519
519
|
forcedError,
|
|
520
|
-
errorHash
|
|
520
|
+
errorHash,
|
|
521
|
+
errorStatusCode
|
|
521
522
|
});
|
|
522
523
|
}
|
|
523
524
|
}
|
|
524
|
-
export function addErrorToAll(name, labelStack, errorType, errorMessage, errorStack, errorHash) {
|
|
525
|
+
export function addErrorToAll(name, labelStack, errorType, errorMessage, errorStack, errorHash, errorStatusCode) {
|
|
525
526
|
interactions.forEach(interaction => {
|
|
526
527
|
interaction.errors.push({
|
|
527
528
|
name,
|
|
@@ -529,7 +530,8 @@ export function addErrorToAll(name, labelStack, errorType, errorMessage, errorSt
|
|
|
529
530
|
errorType,
|
|
530
531
|
errorMessage,
|
|
531
532
|
errorStack,
|
|
532
|
-
errorHash
|
|
533
|
+
errorHash,
|
|
534
|
+
errorStatusCode
|
|
533
535
|
});
|
|
534
536
|
});
|
|
535
537
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
import { getConfig } from '../config';
|
|
4
|
+
import { getPageVisibilityState } from '../hidden-timing';
|
|
4
5
|
import { VCObserverWrapper } from '../vc';
|
|
5
6
|
const POST_INTERACTION_LOG_SEND_DEFAULT_TIMEOUT = 3000;
|
|
6
7
|
export default class PostInteractionLog {
|
|
@@ -96,6 +97,8 @@ export default class PostInteractionLog {
|
|
|
96
97
|
(_this$vcObserver3 = this.vcObserver) === null || _this$vcObserver3 === void 0 ? void 0 : _this$vcObserver3.stop();
|
|
97
98
|
return;
|
|
98
99
|
}
|
|
100
|
+
const pageVisibilityState = getPageVisibilityState(this.lastInteractionFinish.start, this.lastInteractionFinish.end);
|
|
101
|
+
const isPageVisible = pageVisibilityState === 'visible';
|
|
99
102
|
const config = getConfig();
|
|
100
103
|
const postInteractionFinishVCResult = await ((_this$vcObserver4 = this.vcObserver) === null || _this$vcObserver4 === void 0 ? void 0 : _this$vcObserver4.getVCResult({
|
|
101
104
|
start: this.lastInteractionFinish.start,
|
|
@@ -108,7 +111,10 @@ export default class PostInteractionLog {
|
|
|
108
111
|
interactionId: this.lastInteractionFinish.id,
|
|
109
112
|
includeSSRInV3: config === null || config === void 0 ? void 0 : (_config$vc = config.vc) === null || _config$vc === void 0 ? void 0 : _config$vc.includeSSRInV3,
|
|
110
113
|
includeSSRRatio: config === null || config === void 0 ? void 0 : (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRRatio,
|
|
111
|
-
...this.vcObserverSSRConfig
|
|
114
|
+
...this.vcObserverSSRConfig,
|
|
115
|
+
interactionType: this.lastInteractionFinish.type,
|
|
116
|
+
isPageVisible,
|
|
117
|
+
interactionAbortReason: this.lastInteractionFinish.abortReason
|
|
112
118
|
}));
|
|
113
119
|
(_this$vcObserver5 = this.vcObserver) === null || _this$vcObserver5 === void 0 ? void 0 : _this$vcObserver5.stop();
|
|
114
120
|
this.sinkHandlerFn({
|
package/dist/es2019/vc/index.js
CHANGED
|
@@ -105,7 +105,10 @@ export class VCObserverWrapper {
|
|
|
105
105
|
interactionId: param.interactionId,
|
|
106
106
|
ssr: param.includeSSRInV3 ? param.ssr : undefined,
|
|
107
107
|
include3p,
|
|
108
|
-
excludeSmartAnswersInSearch
|
|
108
|
+
excludeSmartAnswersInSearch,
|
|
109
|
+
interactionType: param.interactionType,
|
|
110
|
+
isPageVisible: param.isPageVisible,
|
|
111
|
+
interactionAbortReason: param.interactionAbortReason
|
|
109
112
|
})) : [];
|
|
110
113
|
if (!v3Result) {
|
|
111
114
|
return v1v2Result !== null && v1v2Result !== void 0 ? v1v2Result : {};
|
|
@@ -196,6 +196,9 @@ export default class VCObserverNew {
|
|
|
196
196
|
start,
|
|
197
197
|
stop,
|
|
198
198
|
interactionId,
|
|
199
|
+
interactionType,
|
|
200
|
+
interactionAbortReason,
|
|
201
|
+
isPageVisible,
|
|
199
202
|
include3p,
|
|
200
203
|
excludeSmartAnswersInSearch
|
|
201
204
|
} = param;
|
|
@@ -214,9 +217,12 @@ export default class VCObserverNew {
|
|
|
214
217
|
startTime: start,
|
|
215
218
|
stopTime: stop,
|
|
216
219
|
interactionId,
|
|
220
|
+
interactionType,
|
|
217
221
|
isPostInteraction: this.isPostInteraction,
|
|
218
222
|
include3p,
|
|
219
|
-
excludeSmartAnswersInSearch
|
|
223
|
+
excludeSmartAnswersInSearch,
|
|
224
|
+
isPageVisible,
|
|
225
|
+
interactionAbortReason
|
|
220
226
|
});
|
|
221
227
|
if (fy25_03) {
|
|
222
228
|
results.push(fy25_03);
|
|
@@ -230,8 +236,11 @@ export default class VCObserverNew {
|
|
|
230
236
|
startTime: start,
|
|
231
237
|
stopTime: stop,
|
|
232
238
|
interactionId,
|
|
239
|
+
interactionType,
|
|
233
240
|
isPostInteraction: this.isPostInteraction,
|
|
234
|
-
include3p
|
|
241
|
+
include3p,
|
|
242
|
+
isPageVisible,
|
|
243
|
+
interactionAbortReason
|
|
235
244
|
});
|
|
236
245
|
if (vcNext) {
|
|
237
246
|
results.push(vcNext);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
import getPageVisibilityUpToTTAI from '../../../create-payload/utils/get-page-visibility-up-to-ttai';
|
|
3
|
-
import { getInteractionId } from '../../../interaction-id-context';
|
|
4
|
-
import { interactions } from '../../../interaction-metrics/common/constants';
|
|
5
2
|
import { cssIssueOccurrence } from '../viewport-observer/utils/track-display-content-occurrence';
|
|
6
3
|
import { calculateTTVCPercentilesWithDebugInfo } from './percentile-calc';
|
|
7
4
|
import getViewportHeight from './utils/get-viewport-height';
|
|
@@ -55,7 +52,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
55
52
|
}
|
|
56
53
|
return labelStacks;
|
|
57
54
|
}
|
|
58
|
-
async calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch) {
|
|
55
|
+
async calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason) {
|
|
59
56
|
var _window, _window2, _window6, _window8;
|
|
60
57
|
const percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99, 100];
|
|
61
58
|
const viewportEntries = this.filterViewportEntries(filteredEntries);
|
|
@@ -212,18 +209,13 @@ export default class AbstractVCCalculatorBase {
|
|
|
212
209
|
let v3RevisionDebugDetails = null;
|
|
213
210
|
if (shouldCalculateDebugDetails) {
|
|
214
211
|
if (fg('platform_ufo_unify_abort_status_in_ttvc_debug_data')) {
|
|
215
|
-
var _activeInteractionId$;
|
|
216
|
-
// NOTE: using this instead of directly calling `getActiveInteraction()` to get around circular dependencies
|
|
217
|
-
const activeInteractionId = getInteractionId();
|
|
218
|
-
const activeInteraction = interactions.get((_activeInteractionId$ = activeInteractionId.current) !== null && _activeInteractionId$ !== void 0 ? _activeInteractionId$ : '');
|
|
219
|
-
const pageVisibilityUpToTTAI = activeInteraction ? getPageVisibilityUpToTTAI(activeInteraction) : null;
|
|
220
|
-
const isBackgrounded = pageVisibilityUpToTTAI !== 'visible';
|
|
221
212
|
v3RevisionDebugDetails = {
|
|
222
213
|
revision: this.revisionNo,
|
|
223
|
-
isClean: isVCClean && !
|
|
224
|
-
abortReason:
|
|
214
|
+
isClean: isVCClean && !interactionAbortReason && isPageVisible,
|
|
215
|
+
abortReason: !isPageVisible ? 'browser_backgrounded' : dirtyReason !== null && dirtyReason !== void 0 ? dirtyReason : interactionAbortReason,
|
|
225
216
|
vcLogs: enhancedVcLogs,
|
|
226
|
-
interactionId
|
|
217
|
+
interactionId,
|
|
218
|
+
interactionType
|
|
227
219
|
};
|
|
228
220
|
} else {
|
|
229
221
|
v3RevisionDebugDetails = {
|
|
@@ -274,7 +266,10 @@ export default class AbstractVCCalculatorBase {
|
|
|
274
266
|
interactionId,
|
|
275
267
|
isPostInteraction,
|
|
276
268
|
include3p,
|
|
277
|
-
excludeSmartAnswersInSearch
|
|
269
|
+
excludeSmartAnswersInSearch,
|
|
270
|
+
interactionType,
|
|
271
|
+
isPageVisible,
|
|
272
|
+
interactionAbortReason
|
|
278
273
|
}) {
|
|
279
274
|
var _vcDetails$90$t, _vcDetails$;
|
|
280
275
|
const filteredEntries = orderedEntries.filter(entry => {
|
|
@@ -294,7 +289,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
294
289
|
abortTimestamp: getVCCleanStatusResult.abortTimestamp
|
|
295
290
|
};
|
|
296
291
|
}
|
|
297
|
-
const vcDetails = await this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch);
|
|
292
|
+
const vcDetails = await this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason);
|
|
298
293
|
const result = {
|
|
299
294
|
revision: this.revisionNo,
|
|
300
295
|
clean: true,
|
|
@@ -84,18 +84,19 @@ export function getExperimentalVCMetrics(_x) {
|
|
|
84
84
|
}
|
|
85
85
|
function _getExperimentalVCMetrics() {
|
|
86
86
|
_getExperimentalVCMetrics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(interaction) {
|
|
87
|
-
var vcObserver, _interaction$apdex, prefix, result, VC
|
|
87
|
+
var vcObserver, pageVisibilityUpToTTAI, _interaction$apdex, prefix, result, VC;
|
|
88
88
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
89
89
|
while (1) switch (_context.prev = _context.next) {
|
|
90
90
|
case 0:
|
|
91
91
|
// Use per-interaction VC observer if available, otherwise fall back to global experimentalVC
|
|
92
92
|
vcObserver = interaction.experimentalVCObserver || experimentalVC.vcObserver;
|
|
93
|
+
pageVisibilityUpToTTAI = getPageVisibilityState(interaction.start, interaction.end);
|
|
93
94
|
if (!vcObserver) {
|
|
94
95
|
_context.next = 13;
|
|
95
96
|
break;
|
|
96
97
|
}
|
|
97
98
|
prefix = 'ufo-experimental';
|
|
98
|
-
_context.next =
|
|
99
|
+
_context.next = 6;
|
|
99
100
|
return vcObserver.getVCResult({
|
|
100
101
|
start: interaction.start,
|
|
101
102
|
stop: interaction.end,
|
|
@@ -104,18 +105,20 @@ function _getExperimentalVCMetrics() {
|
|
|
104
105
|
prefix: prefix,
|
|
105
106
|
vc: interaction.vc,
|
|
106
107
|
experienceKey: interaction.ufoName,
|
|
107
|
-
interactionId: interaction.id
|
|
108
|
+
interactionId: interaction.id,
|
|
109
|
+
interactionType: interaction.type,
|
|
110
|
+
isPageVisible: pageVisibilityUpToTTAI === 'visible',
|
|
111
|
+
interactionAbortReason: interaction.abortReason
|
|
108
112
|
});
|
|
109
|
-
case
|
|
113
|
+
case 6:
|
|
110
114
|
result = _context.sent;
|
|
111
115
|
VC = result === null || result === void 0 ? void 0 : result['metrics:vc'];
|
|
112
116
|
if (!(!VC || !(result !== null && result !== void 0 && result["".concat(prefix, ":vc:clean")]))) {
|
|
113
|
-
_context.next =
|
|
117
|
+
_context.next = 10;
|
|
114
118
|
break;
|
|
115
119
|
}
|
|
116
120
|
return _context.abrupt("return", result);
|
|
117
|
-
case
|
|
118
|
-
pageVisibilityUpToTTAI = getPageVisibilityState(interaction.start, interaction.end);
|
|
121
|
+
case 10:
|
|
119
122
|
if (!(interaction.abortReason || pageVisibilityUpToTTAI !== 'visible')) {
|
|
120
123
|
_context.next = 12;
|
|
121
124
|
break;
|