@atlaskit/react-ufo 3.9.2 → 3.9.3

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 3.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#149225](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149225)
8
+ [`212d1bc6cd2a7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/212d1bc6cd2a7) -
9
+ set the FAILED status client side, and ignore BM3 TTI event status
10
+ - [#148864](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148864)
11
+ [`93b2b5271da55`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/93b2b5271da55) -
12
+ FF cleanup: platform_ufo_custom_data_structured_clone
13
+
3
14
  ## 3.9.2
4
15
 
5
16
  ### Patch Changes
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
7
8
  /**
8
9
  * Determines the interaction status based on abort reason and BM3 TTI presence.
9
10
  *
@@ -28,8 +29,12 @@ exports.default = void 0;
28
29
  */
29
30
  function getInteractionStatus(interaction) {
30
31
  var originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
32
+ var hasErrors = interaction.errors.length > 0;
33
+ if ((0, _platformFeatureFlags.fg)('platform_ufo_set_event_failed_status_in_client')) {
34
+ originalInteractionStatus = hasErrors ? 'FAILED' : originalInteractionStatus;
35
+ }
31
36
  var hasBm3TTI = interaction.apdex.length > 0;
32
- var overrideStatus = hasBm3TTI ? 'SUCCEEDED' : originalInteractionStatus;
37
+ var overrideStatus = hasBm3TTI && !(0, _platformFeatureFlags.fg)('platform_ufo_ignore_bm3_tti_event_status') ? 'SUCCEEDED' : originalInteractionStatus;
33
38
  return {
34
39
  originalInteractionStatus: originalInteractionStatus,
35
40
  overrideStatus: overrideStatus
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.addUFOCustomData = addUFOCustomData;
8
8
  exports.default = UFOCustomData;
9
9
  var _react = require("react");
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
10
  var _interactionContext = _interopRequireDefault(require("../interaction-context"));
12
11
  var _interactionIdContext = require("../interaction-id-context");
13
12
  var _interactionMetrics = require("../interaction-metrics");
@@ -18,7 +17,7 @@ function UFOCustomData(_ref) {
18
17
  if (!interactionContext) {
19
18
  return;
20
19
  }
21
- if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function' && (0, _platformFeatureFlags.fg)('platform_ufo_custom_data_structured_clone')) {
20
+ if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
22
21
  interactionContext.addCustomData(globalThis.structuredClone(data));
23
22
  } else {
24
23
  interactionContext.addCustomData(data);
@@ -32,7 +31,7 @@ function addUFOCustomData(data) {
32
31
  if (!currentInteractionId) {
33
32
  return;
34
33
  }
35
- if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function' && (0, _platformFeatureFlags.fg)('platform_ufo_custom_data_structured_clone')) {
34
+ if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
36
35
  (0, _interactionMetrics.addCustomData)(currentInteractionId, [], globalThis.structuredClone(data));
37
36
  } else {
38
37
  (0, _interactionMetrics.addCustomData)(currentInteractionId, [], data);
@@ -1,3 +1,4 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  /**
2
3
  * Determines the interaction status based on abort reason and BM3 TTI presence.
3
4
  *
@@ -21,9 +22,13 @@
21
22
  * // Returns: { originalInteractionStatus: 'SUCCEEDED', overrideStatus: 'SUCCEEDED' }
22
23
  */
23
24
  function getInteractionStatus(interaction) {
24
- const originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
25
+ let originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
26
+ const hasErrors = interaction.errors.length > 0;
27
+ if (fg('platform_ufo_set_event_failed_status_in_client')) {
28
+ originalInteractionStatus = hasErrors ? 'FAILED' : originalInteractionStatus;
29
+ }
25
30
  const hasBm3TTI = interaction.apdex.length > 0;
26
- const overrideStatus = hasBm3TTI ? 'SUCCEEDED' : originalInteractionStatus;
31
+ const overrideStatus = hasBm3TTI && !fg('platform_ufo_ignore_bm3_tti_event_status') ? 'SUCCEEDED' : originalInteractionStatus;
27
32
  return {
28
33
  originalInteractionStatus,
29
34
  overrideStatus
@@ -1,5 +1,4 @@
1
1
  import { useContext, useMemo } from 'react';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import UFOInteractionContext from '../interaction-context';
4
3
  import { getInteractionId } from '../interaction-id-context';
5
4
  import { addCustomData } from '../interaction-metrics';
@@ -11,7 +10,7 @@ export default function UFOCustomData({
11
10
  if (!interactionContext) {
12
11
  return;
13
12
  }
14
- if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function' && fg('platform_ufo_custom_data_structured_clone')) {
13
+ if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
15
14
  interactionContext.addCustomData(globalThis.structuredClone(data));
16
15
  } else {
17
16
  interactionContext.addCustomData(data);
@@ -25,7 +24,7 @@ export function addUFOCustomData(data) {
25
24
  if (!currentInteractionId) {
26
25
  return;
27
26
  }
28
- if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function' && fg('platform_ufo_custom_data_structured_clone')) {
27
+ if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
29
28
  addCustomData(currentInteractionId, [], globalThis.structuredClone(data));
30
29
  } else {
31
30
  addCustomData(currentInteractionId, [], data);
@@ -1,3 +1,4 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  /**
2
3
  * Determines the interaction status based on abort reason and BM3 TTI presence.
3
4
  *
@@ -22,8 +23,12 @@
22
23
  */
23
24
  function getInteractionStatus(interaction) {
24
25
  var originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
26
+ var hasErrors = interaction.errors.length > 0;
27
+ if (fg('platform_ufo_set_event_failed_status_in_client')) {
28
+ originalInteractionStatus = hasErrors ? 'FAILED' : originalInteractionStatus;
29
+ }
25
30
  var hasBm3TTI = interaction.apdex.length > 0;
26
- var overrideStatus = hasBm3TTI ? 'SUCCEEDED' : originalInteractionStatus;
31
+ var overrideStatus = hasBm3TTI && !fg('platform_ufo_ignore_bm3_tti_event_status') ? 'SUCCEEDED' : originalInteractionStatus;
27
32
  return {
28
33
  originalInteractionStatus: originalInteractionStatus,
29
34
  overrideStatus: overrideStatus
@@ -1,5 +1,4 @@
1
1
  import { useContext, useMemo } from 'react';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import UFOInteractionContext from '../interaction-context';
4
3
  import { getInteractionId } from '../interaction-id-context';
5
4
  import { addCustomData } from '../interaction-metrics';
@@ -10,7 +9,7 @@ export default function UFOCustomData(_ref) {
10
9
  if (!interactionContext) {
11
10
  return;
12
11
  }
13
- if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function' && fg('platform_ufo_custom_data_structured_clone')) {
12
+ if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
14
13
  interactionContext.addCustomData(globalThis.structuredClone(data));
15
14
  } else {
16
15
  interactionContext.addCustomData(data);
@@ -24,7 +23,7 @@ export function addUFOCustomData(data) {
24
23
  if (!currentInteractionId) {
25
24
  return;
26
25
  }
27
- if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function' && fg('platform_ufo_custom_data_structured_clone')) {
26
+ if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.structuredClone) === 'function') {
28
27
  addCustomData(currentInteractionId, [], globalThis.structuredClone(data));
29
28
  } else {
30
29
  addCustomData(currentInteractionId, [], data);
@@ -22,7 +22,7 @@ import type { InteractionMetrics } from '../../common';
22
22
  * // Returns: { originalInteractionStatus: 'SUCCEEDED', overrideStatus: 'SUCCEEDED' }
23
23
  */
24
24
  declare function getInteractionStatus(interaction: InteractionMetrics): {
25
- readonly originalInteractionStatus: "ABORTED" | "SUCCEEDED";
26
- readonly overrideStatus: "ABORTED" | "SUCCEEDED";
25
+ readonly originalInteractionStatus: string;
26
+ readonly overrideStatus: string;
27
27
  };
28
28
  export default getInteractionStatus;
@@ -22,7 +22,7 @@ import type { InteractionMetrics } from '../../common';
22
22
  * // Returns: { originalInteractionStatus: 'SUCCEEDED', overrideStatus: 'SUCCEEDED' }
23
23
  */
24
24
  declare function getInteractionStatus(interaction: InteractionMetrics): {
25
- readonly originalInteractionStatus: "ABORTED" | "SUCCEEDED";
26
- readonly overrideStatus: "ABORTED" | "SUCCEEDED";
25
+ readonly originalInteractionStatus: string;
26
+ readonly overrideStatus: string;
27
27
  };
28
28
  export default getInteractionStatus;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "3.9.2",
3
+ "version": "3.9.3",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -139,15 +139,18 @@
139
139
  "platform_ufo_vc_observer_new": {
140
140
  "type": "boolean"
141
141
  },
142
- "platform_ufo_custom_data_structured_clone": {
143
- "type": "boolean"
144
- },
145
142
  "enable_ufo_devtools_api_for_extra_events": {
146
143
  "type": "boolean"
147
144
  },
148
145
  "platform_ufo_no_vc_on_aborted": {
149
146
  "type": "boolean"
150
147
  },
148
+ "platform_ufo_set_event_failed_status_in_client": {
149
+ "type": "boolean"
150
+ },
151
+ "platform_ufo_ignore_bm3_tti_event_status": {
152
+ "type": "boolean"
153
+ },
151
154
  "ufo_payload_use_idle_callback": {
152
155
  "type": "boolean"
153
156
  },