@atlaskit/react-ufo 5.5.0 → 5.5.2

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/AGENTS.md CHANGED
@@ -257,12 +257,10 @@ The package uses platform feature flags for gradual rollouts. Key flags are defi
257
257
 
258
258
  | Flag | Purpose |
259
259
  | --------------------------------------------------- | -------------------------------- |
260
- | `platform_ufo_enable_ttai_with_3p` | Third-party segment timing |
261
260
  | `platform_ufo_enable_vc_raw_data` | Raw VC data inclusion |
262
261
  | `platform_ufo_segment_critical_metrics` | Segment-level metrics |
263
262
  | `platform_ufo_enable_terminal_errors` | Terminal error tracking |
264
263
  | `platform_ufo_raw_data_thirdparty` | Third-party raw data behavior |
265
- | `platform_ufo_enable_finish_interaction_transition` | Finish interaction on transition |
266
264
 
267
265
  ## Testing
268
266
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 5.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`74b7d44630b84`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/74b7d44630b84) -
8
+ Clean up feature gate platform_ufo_enable_finish_interaction_transition - gate always evaluates to
9
+ true
10
+
11
+ ## 5.5.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`d52302fe9ea1b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d52302fe9ea1b) -
16
+ Clean up platform_ufo_exclude_3p_attribute_changes feature gate, assuming always true
17
+ - [`ac3d03af6d443`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ac3d03af6d443) -
18
+ Clean up feature gate platform_ufo_exclude_3p_elements_from_ttai - gate always evaluates to true
19
+
3
20
  ## 5.5.0
4
21
 
5
22
  ### Minor Changes
@@ -404,7 +404,7 @@ function removeHoldCriterion(id) {
404
404
  }
405
405
  window.__CRITERION__.removeUFOHold(id);
406
406
  }
407
- function addHold(interactionId, labelStack, name, experimental) {
407
+ function addHold(interactionId, labelStack, name, _experimental) {
408
408
  var interaction = _constants.interactions.get(interactionId);
409
409
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
410
410
  var id = (0, _uuid.v4)();
@@ -419,35 +419,20 @@ function addHold(interactionId, labelStack, name, experimental) {
419
419
  name: name,
420
420
  start: start
421
421
  };
422
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
423
- var is3pHold = labelStack.some(function (l) {
424
- return 'type' in l && l.type === 'third-party';
425
- });
426
- if (is3pHold) {
427
- if (!interaction.hold3pActive) {
428
- interaction.hold3pActive = new Map();
429
- }
430
- interaction.hold3pActive.set(id, _objectSpread(_objectSpread({}, holdActive), {}, {
431
- start: start
432
- }));
433
- } else {
434
- interaction.holdActive.set(id, _objectSpread(_objectSpread({}, holdActive), {}, {
435
- start: start
436
- }));
437
- addHoldCriterion(id, labelStack, name, start);
422
+ var is3pHold = labelStack.some(function (l) {
423
+ return 'type' in l && l.type === 'third-party';
424
+ });
425
+ if (is3pHold) {
426
+ if (!interaction.hold3pActive) {
427
+ interaction.hold3pActive = new Map();
438
428
  }
429
+ interaction.hold3pActive.set(id, _objectSpread(_objectSpread({}, holdActive), {}, {
430
+ start: start
431
+ }));
439
432
  } else {
440
- var _getConfig2;
441
- if ((_getConfig2 = (0, _config.getConfig)()) !== null && _getConfig2 !== void 0 && (_getConfig2 = _getConfig2.experimentalInteractionMetrics) !== null && _getConfig2 !== void 0 && _getConfig2.enabled && experimental) {
442
- interaction.holdExpActive.set(id, _objectSpread(_objectSpread({}, holdActive), {}, {
443
- start: start
444
- }));
445
- }
446
- if (!experimental) {
447
- interaction.holdActive.set(id, _objectSpread(_objectSpread({}, holdActive), {}, {
448
- start: start
449
- }));
450
- }
433
+ interaction.holdActive.set(id, _objectSpread(_objectSpread({}, holdActive), {}, {
434
+ start: start
435
+ }));
451
436
  addHoldCriterion(id, labelStack, name, start);
452
437
  }
453
438
  return function () {
@@ -486,18 +471,16 @@ function addHold(interactionId, labelStack, name, experimental) {
486
471
  }));
487
472
  interaction.holdExpActive.delete(id);
488
473
  }
489
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
490
- if (interaction.hold3pActive) {
491
- var current3pHold = interaction.hold3pActive.get(id);
492
- if (current3pHold != null) {
493
- if (!currentInteraction.hold3pInfo) {
494
- currentInteraction.hold3pInfo = [];
495
- }
496
- currentInteraction.hold3pInfo.push(_objectSpread(_objectSpread({}, current3pHold), {}, {
497
- end: end
498
- }));
499
- interaction.hold3pActive.delete(id);
474
+ if (interaction.hold3pActive) {
475
+ var current3pHold = interaction.hold3pActive.get(id);
476
+ if (current3pHold != null) {
477
+ if (!currentInteraction.hold3pInfo) {
478
+ currentInteraction.hold3pInfo = [];
500
479
  }
480
+ currentInteraction.hold3pInfo.push(_objectSpread(_objectSpread({}, current3pHold), {}, {
481
+ end: end
482
+ }));
483
+ interaction.hold3pActive.delete(id);
501
484
  }
502
485
  }
503
486
  }
@@ -509,29 +492,19 @@ function addHoldByID(interactionId, labelStack, name, id, ignoreOnSubmit) {
509
492
  var interaction = _constants.interactions.get(interactionId);
510
493
  if (interaction != null) {
511
494
  var start = performance.now();
512
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
513
- var is3pHold = labelStack.some(function (l) {
514
- return 'type' in l && l.type === 'third-party';
515
- });
516
- if (is3pHold) {
517
- if (!interaction.hold3pActive) {
518
- interaction.hold3pActive = new Map();
519
- }
520
- interaction.hold3pActive.set(id, {
521
- labelStack: labelStack,
522
- name: name,
523
- start: start,
524
- ignoreOnSubmit: ignoreOnSubmit
525
- });
526
- } else {
527
- interaction.holdActive.set(id, {
528
- labelStack: labelStack,
529
- name: name,
530
- start: start,
531
- ignoreOnSubmit: ignoreOnSubmit
532
- });
533
- addHoldCriterion(id, labelStack, name, start);
495
+ var is3pHold = labelStack.some(function (l) {
496
+ return 'type' in l && l.type === 'third-party';
497
+ });
498
+ if (is3pHold) {
499
+ if (!interaction.hold3pActive) {
500
+ interaction.hold3pActive = new Map();
534
501
  }
502
+ interaction.hold3pActive.set(id, {
503
+ labelStack: labelStack,
504
+ name: name,
505
+ start: start,
506
+ ignoreOnSubmit: ignoreOnSubmit
507
+ });
535
508
  } else {
536
509
  interaction.holdActive.set(id, {
537
510
  labelStack: labelStack,
@@ -557,18 +530,16 @@ function removeHoldByID(interactionId, id) {
557
530
  interaction.holdActive.delete(id);
558
531
  removeHoldCriterion(id);
559
532
  }
560
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
561
- if (interaction.hold3pActive) {
562
- var current3pHold = interaction.hold3pActive.get(id);
563
- if (currentInteraction != null && current3pHold != null) {
564
- if (!currentInteraction.hold3pInfo) {
565
- currentInteraction.hold3pInfo = [];
566
- }
567
- currentInteraction.hold3pInfo.push(_objectSpread(_objectSpread({}, current3pHold), {}, {
568
- end: end
569
- }));
570
- interaction.hold3pActive.delete(id);
533
+ if (interaction.hold3pActive) {
534
+ var current3pHold = interaction.hold3pActive.get(id);
535
+ if (currentInteraction != null && current3pHold != null) {
536
+ if (!currentInteraction.hold3pInfo) {
537
+ currentInteraction.hold3pInfo = [];
571
538
  }
539
+ currentInteraction.hold3pInfo.push(_objectSpread(_objectSpread({}, current3pHold), {}, {
540
+ end: end
541
+ }));
542
+ interaction.hold3pActive.delete(id);
572
543
  }
573
544
  }
574
545
  }
@@ -644,7 +615,7 @@ function addErrorToAll(name, labelStack, errorType, errorMessage, errorStack, er
644
615
  });
645
616
  }
646
617
  function addProfilerTimings(interactionId, labelStack, type, actualDuration, baseDuration, startTime, commitTime) {
647
- var _getConfig3;
618
+ var _getConfig2;
648
619
  if (isPerformanceTracingEnabled()) {
649
620
  try {
650
621
  // for Firefox 102 and older
@@ -672,7 +643,7 @@ function addProfilerTimings(interactionId, labelStack, type, actualDuration, bas
672
643
  startTime: startTime,
673
644
  commitTime: commitTime
674
645
  });
675
- } else if ((_getConfig3 = (0, _config.getConfig)()) !== null && _getConfig3 !== void 0 && (_getConfig3 = _getConfig3.postInteractionLog) !== null && _getConfig3 !== void 0 && _getConfig3.enabled) {
646
+ } else if ((_getConfig2 = (0, _config.getConfig)()) !== null && _getConfig2 !== void 0 && (_getConfig2 = _getConfig2.postInteractionLog) !== null && _getConfig2 !== void 0 && _getConfig2.enabled) {
676
647
  postInteractionLog.addProfilerTimings(labelStack, type, actualDuration, baseDuration, startTime, commitTime);
677
648
  }
678
649
  }
@@ -689,7 +660,7 @@ function callCleanUpCallbacks(interaction) {
689
660
  });
690
661
  }
691
662
  function finishInteraction(id, data) {
692
- var _getConfig4;
663
+ var _getConfig3;
693
664
  var endTime = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : performance.now();
694
665
  data.end = endTime;
695
666
  try {
@@ -722,7 +693,7 @@ function finishInteraction(id, data) {
722
693
  (0, _experienceTraceIdContext.clearActiveTrace)();
723
694
  callCleanUpCallbacks(data);
724
695
  (0, _ssrRenderProfiler.flushSsrRenderProfilerTraces)();
725
- if ((_getConfig4 = (0, _config.getConfig)()) !== null && _getConfig4 !== void 0 && (_getConfig4 = _getConfig4.vc) !== null && _getConfig4 !== void 0 && _getConfig4.stopVCAtInteractionFinish) {
696
+ if ((_getConfig3 = (0, _config.getConfig)()) !== null && _getConfig3 !== void 0 && (_getConfig3 = _getConfig3.vc) !== null && _getConfig3 !== void 0 && _getConfig3.stopVCAtInteractionFinish) {
726
697
  // Use per-interaction VC observer if available, otherwise fall back to global
727
698
  var observer = data.vcObserver;
728
699
  if (observer) {
@@ -738,19 +709,11 @@ function finishInteraction(id, data) {
738
709
  if (!(0, _coinflip.default)((0, _config.getPostInteractionRate)(sanitisedUfoName, data.type))) {
739
710
  postInteractionLog.stopVCObserver();
740
711
  }
741
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
742
- var _sanitisedUfoName = (0, _utils.sanitizeUfoName)(data.ufoName);
743
- if (!(0, _coinflip.default)((0, _config.getExtraInteractionRate)(_sanitisedUfoName, data.type))) {
744
- interactionExtraMetrics.stopAll(id);
745
- } else if (!data.hold3pActive || data.hold3pActive.size === 0) {
746
- var _getConfig5;
747
- if (!((_getConfig5 = (0, _config.getConfig)()) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.experimentalInteractionMetrics) !== null && _getConfig5 !== void 0 && _getConfig5.enabled)) {
748
- remove(id);
749
- }
750
- }
751
- } else {
752
- var _getConfig6;
753
- if (!((_getConfig6 = (0, _config.getConfig)()) !== null && _getConfig6 !== void 0 && (_getConfig6 = _getConfig6.experimentalInteractionMetrics) !== null && _getConfig6 !== void 0 && _getConfig6.enabled)) {
712
+ if (!(0, _coinflip.default)((0, _config.getExtraInteractionRate)(sanitisedUfoName, data.type))) {
713
+ interactionExtraMetrics.stopAll(id);
714
+ } else if (!data.hold3pActive || data.hold3pActive.size === 0) {
715
+ var _getConfig4;
716
+ if (!((_getConfig4 = (0, _config.getConfig)()) !== null && _getConfig4 !== void 0 && (_getConfig4 = _getConfig4.experimentalInteractionMetrics) !== null && _getConfig4 !== void 0 && _getConfig4.enabled)) {
754
717
  remove(id);
755
718
  }
756
719
  }
@@ -762,13 +725,9 @@ function finishInteraction(id, data) {
762
725
  PreviousInteractionLog.name = data.ufoName || 'unknown';
763
726
  PreviousInteractionLog.isAborted = data.abortReason != null;
764
727
  if (data.ufoName) {
765
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
766
- var _interactionExtraMetr;
767
- if (((_interactionExtraMetr = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr === void 0 ? void 0 : _interactionExtraMetr.id) !== id) {
768
- // If this same interaction was not already handled, handle it
769
- handleInteraction(id, data);
770
- }
771
- } else {
728
+ var _interactionExtraMetr;
729
+ if (((_interactionExtraMetr = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr === void 0 ? void 0 : _interactionExtraMetr.id) !== id) {
730
+ // If this same interaction was not already handled, handle it
772
731
  handleInteraction(id, data);
773
732
  }
774
733
  }
@@ -844,21 +803,22 @@ var activeSubmitted = false;
844
803
  function tryComplete(interactionId, endTime) {
845
804
  var interaction = _constants.interactions.get(interactionId);
846
805
  if (interaction != null) {
806
+ var _interaction$hold3pAc;
847
807
  var noMoreActiveHolds = interaction.holdActive.size === 0;
848
808
  var noMoreExpHolds = interaction.holdExpActive.size === 0;
849
809
  var shouldUseRawDataThirdParty = (0, _config.shouldUseRawDataThirdPartyBehavior)(interaction.ufoName, interaction.type);
850
810
  var postInteraction = /*#__PURE__*/function () {
851
811
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
852
- var _getConfig7;
853
- var _getConfig8, experimentalVC90, experimentalTTAI, _yield$getExperimenta, start, end, _interactionExtraMetr2, _getConfig9, _getConfig0;
812
+ var _getConfig5, _interactionExtraMetr2;
813
+ var _getConfig6, experimentalVC90, experimentalTTAI, _yield$getExperimenta, start, end, _getConfig7;
854
814
  return _regenerator.default.wrap(function _callee$(_context) {
855
815
  while (1) switch (_context.prev = _context.next) {
856
816
  case 0:
857
- if (!((_getConfig7 = (0, _config.getConfig)()) !== null && _getConfig7 !== void 0 && (_getConfig7 = _getConfig7.postInteractionLog) !== null && _getConfig7 !== void 0 && _getConfig7.enabled)) {
817
+ if (!((_getConfig5 = (0, _config.getConfig)()) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.postInteractionLog) !== null && _getConfig5 !== void 0 && _getConfig5.enabled)) {
858
818
  _context.next = 17;
859
819
  break;
860
820
  }
861
- if (!((_getConfig8 = (0, _config.getConfig)()) !== null && _getConfig8 !== void 0 && (_getConfig8 = _getConfig8.experimentalInteractionMetrics) !== null && _getConfig8 !== void 0 && _getConfig8.enabled)) {
821
+ if (!((_getConfig6 = (0, _config.getConfig)()) !== null && _getConfig6 !== void 0 && (_getConfig6 = _getConfig6.experimentalInteractionMetrics) !== null && _getConfig6 !== void 0 && _getConfig6.enabled)) {
862
822
  _context.next = 16;
863
823
  break;
864
824
  }
@@ -892,15 +852,9 @@ function tryComplete(interactionId, endTime) {
892
852
  experimentalVC90: experimentalVC90
893
853
  }));
894
854
  case 17:
895
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
896
- if (((_interactionExtraMetr2 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr2 === void 0 ? void 0 : _interactionExtraMetr2.id) !== interactionId) {
897
- // If interactionExtraMetrics is not waiting for measuring this interaction
898
- if ((_getConfig9 = (0, _config.getConfig)()) !== null && _getConfig9 !== void 0 && (_getConfig9 = _getConfig9.experimentalInteractionMetrics) !== null && _getConfig9 !== void 0 && _getConfig9.enabled) {
899
- remove(interactionId);
900
- }
901
- }
902
- } else {
903
- if ((_getConfig0 = (0, _config.getConfig)()) !== null && _getConfig0 !== void 0 && (_getConfig0 = _getConfig0.experimentalInteractionMetrics) !== null && _getConfig0 !== void 0 && _getConfig0.enabled) {
855
+ if (((_interactionExtraMetr2 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr2 === void 0 ? void 0 : _interactionExtraMetr2.id) !== interactionId) {
856
+ // If interactionExtraMetrics is not waiting for measuring this interaction
857
+ if ((_getConfig7 = (0, _config.getConfig)()) !== null && _getConfig7 !== void 0 && (_getConfig7 = _getConfig7.experimentalInteractionMetrics) !== null && _getConfig7 !== void 0 && _getConfig7.enabled) {
904
858
  remove(interactionId);
905
859
  }
906
860
  }
@@ -915,103 +869,82 @@ function tryComplete(interactionId, endTime) {
915
869
  return _ref.apply(this, arguments);
916
870
  };
917
871
  }();
918
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
919
- var _interaction$hold3pAc;
920
- var noMoreActive3pHolds = ((_interaction$hold3pAc = interaction.hold3pActive) === null || _interaction$hold3pAc === void 0 ? void 0 : _interaction$hold3pAc.size) === 0 || interaction.hold3pActive === undefined;
872
+ var noMoreActive3pHolds = ((_interaction$hold3pAc = interaction.hold3pActive) === null || _interaction$hold3pAc === void 0 ? void 0 : _interaction$hold3pAc.size) === 0 || interaction.hold3pActive === undefined;
921
873
 
922
- // If using raw data third party behavior, wait for 3p holds to clear
923
- if (shouldUseRawDataThirdParty) {
924
- // If there are no non-3p holds active, mark the interaction as successful
925
- // but don't finish until 3p holds are cleared
926
- if (noMoreActiveHolds && !noMoreActive3pHolds) {
927
- // Mark interaction as successful by setting endTime, but don't finish yet
928
- if (endTime !== undefined && interaction.end === 0) {
929
- interaction.end = endTime;
930
- }
931
- // Wait for 3p holds to clear before finishing
932
- return;
874
+ // If using raw data third party behavior, wait for 3p holds to clear
875
+ if (shouldUseRawDataThirdParty) {
876
+ // If there are no non-3p holds active, mark the interaction as successful
877
+ // but don't finish until 3p holds are cleared
878
+ if (noMoreActiveHolds && !noMoreActive3pHolds) {
879
+ // Mark interaction as successful by setting endTime, but don't finish yet
880
+ if (endTime !== undefined && interaction.end === 0) {
881
+ interaction.end = endTime;
933
882
  }
883
+ // Wait for 3p holds to clear before finishing
884
+ return;
885
+ }
934
886
 
935
- // If all holds (including 3p) are cleared, finish the interaction
936
- if (noMoreActiveHolds && noMoreActive3pHolds) {
937
- if (!activeSubmitted) {
938
- var _getConfig1, _getConfig10, _getConfig11;
939
- // Set end3p to current time when 3p holds cleared, but ensure it's at least interaction.end
940
- var currentTime = endTime !== null && endTime !== void 0 ? endTime : performance.now();
941
- interaction.end3p = interaction.end !== 0 && currentTime < interaction.end ? interaction.end : currentTime;
942
- finishInteraction(interactionId, interaction, interaction.end !== 0 ? interaction.end : endTime);
943
- if ((_getConfig1 = (0, _config.getConfig)()) !== null && _getConfig1 !== void 0 && (_getConfig1 = _getConfig1.extraInteractionMetrics) !== null && _getConfig1 !== void 0 && _getConfig1.enabled) {
944
- interactionExtraMetrics.updateFinishedInteraction(interaction);
945
- }
946
- if ((_getConfig10 = (0, _config.getConfig)()) !== null && _getConfig10 !== void 0 && (_getConfig10 = _getConfig10.extraSearchPageInteraction) !== null && _getConfig10 !== void 0 && _getConfig10.enabled && interaction.ufoName === ((_getConfig11 = (0, _config.getConfig)()) === null || _getConfig11 === void 0 || (_getConfig11 = _getConfig11.extraSearchPageInteraction) === null || _getConfig11 === void 0 ? void 0 : _getConfig11.searchPageMetricName)) {
947
- (0, _createExtraSearchPageInteractionPayload.onSearchPageInteractionComplete)(interactionId, interaction);
948
- }
949
- activeSubmitted = true;
887
+ // If all holds (including 3p) are cleared, finish the interaction
888
+ if (noMoreActiveHolds && noMoreActive3pHolds) {
889
+ if (!activeSubmitted) {
890
+ var _getConfig8, _getConfig9, _getConfig0;
891
+ // Set end3p to current time when 3p holds cleared, but ensure it's at least interaction.end
892
+ var currentTime = endTime !== null && endTime !== void 0 ? endTime : performance.now();
893
+ interaction.end3p = interaction.end !== 0 && currentTime < interaction.end ? interaction.end : currentTime;
894
+ finishInteraction(interactionId, interaction, interaction.end !== 0 ? interaction.end : endTime);
895
+ if ((_getConfig8 = (0, _config.getConfig)()) !== null && _getConfig8 !== void 0 && (_getConfig8 = _getConfig8.extraInteractionMetrics) !== null && _getConfig8 !== void 0 && _getConfig8.enabled) {
896
+ interactionExtraMetrics.updateFinishedInteraction(interaction);
950
897
  }
951
- if (noMoreExpHolds) {
952
- var _getConfig12;
953
- if ((_getConfig12 = (0, _config.getConfig)()) !== null && _getConfig12 !== void 0 && (_getConfig12 = _getConfig12.experimentalInteractionMetrics) !== null && _getConfig12 !== void 0 && _getConfig12.enabled) {
954
- (0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime || interaction.end);
955
- }
956
- postInteraction();
898
+ if ((_getConfig9 = (0, _config.getConfig)()) !== null && _getConfig9 !== void 0 && (_getConfig9 = _getConfig9.extraSearchPageInteraction) !== null && _getConfig9 !== void 0 && _getConfig9.enabled && interaction.ufoName === ((_getConfig0 = (0, _config.getConfig)()) === null || _getConfig0 === void 0 || (_getConfig0 = _getConfig0.extraSearchPageInteraction) === null || _getConfig0 === void 0 ? void 0 : _getConfig0.searchPageMetricName)) {
899
+ (0, _createExtraSearchPageInteractionPayload.onSearchPageInteractionComplete)(interactionId, interaction);
957
900
  }
901
+ activeSubmitted = true;
958
902
  }
959
- // Send separated third-party event even when feature flag is active
960
- if (noMoreActiveHolds && noMoreActive3pHolds) {
961
- var data = _objectSpread(_objectSpread({}, interaction), {}, {
962
- end: endTime || interaction.end
963
- });
964
- interactionExtraMetrics.onInteractionComplete(interactionId, data);
965
- }
966
- } else {
967
- var _interactionExtraMetr3;
968
- // Original behavior when feature flag is not active
969
- if (noMoreActiveHolds && ((_interactionExtraMetr3 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr3 === void 0 ? void 0 : _interactionExtraMetr3.id) !== interactionId) {
970
- // If it's not waiting for extra metrics to complete, finish the interaction as normal
971
- if (!activeSubmitted) {
972
- var _getConfig13, _getConfig14, _getConfig15;
973
- finishInteraction(interactionId, interaction, endTime);
974
- if ((_getConfig13 = (0, _config.getConfig)()) !== null && _getConfig13 !== void 0 && (_getConfig13 = _getConfig13.extraInteractionMetrics) !== null && _getConfig13 !== void 0 && _getConfig13.enabled) {
975
- interactionExtraMetrics.updateFinishedInteraction(interaction);
976
- }
977
- if ((_getConfig14 = (0, _config.getConfig)()) !== null && _getConfig14 !== void 0 && (_getConfig14 = _getConfig14.extraSearchPageInteraction) !== null && _getConfig14 !== void 0 && _getConfig14.enabled && interaction.ufoName === ((_getConfig15 = (0, _config.getConfig)()) === null || _getConfig15 === void 0 || (_getConfig15 = _getConfig15.extraSearchPageInteraction) === null || _getConfig15 === void 0 ? void 0 : _getConfig15.searchPageMetricName)) {
978
- (0, _createExtraSearchPageInteractionPayload.onSearchPageInteractionComplete)(interactionId, interaction);
979
- }
980
- activeSubmitted = true;
981
- }
982
- if (noMoreExpHolds) {
983
- var _getConfig16;
984
- if ((_getConfig16 = (0, _config.getConfig)()) !== null && _getConfig16 !== void 0 && (_getConfig16 = _getConfig16.experimentalInteractionMetrics) !== null && _getConfig16 !== void 0 && _getConfig16.enabled) {
985
- (0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime);
986
- }
987
- postInteraction();
903
+ if (noMoreExpHolds) {
904
+ var _getConfig1;
905
+ if ((_getConfig1 = (0, _config.getConfig)()) !== null && _getConfig1 !== void 0 && (_getConfig1 = _getConfig1.experimentalInteractionMetrics) !== null && _getConfig1 !== void 0 && _getConfig1.enabled) {
906
+ (0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime || interaction.end);
988
907
  }
908
+ postInteraction();
989
909
  }
990
- if (noMoreActiveHolds && noMoreActive3pHolds) {
991
- var _data2 = _objectSpread(_objectSpread({}, interaction), {}, {
992
- end: endTime
993
- });
994
- interactionExtraMetrics.onInteractionComplete(interactionId, _data2);
995
- }
910
+ }
911
+ // Send separated third-party event even when feature flag is active
912
+ if (noMoreActiveHolds && noMoreActive3pHolds) {
913
+ var data = _objectSpread(_objectSpread({}, interaction), {}, {
914
+ end: endTime || interaction.end
915
+ });
916
+ interactionExtraMetrics.onInteractionComplete(interactionId, data);
996
917
  }
997
918
  } else {
998
- if (noMoreActiveHolds) {
919
+ var _interactionExtraMetr3;
920
+ // Original behavior when feature flag is not active
921
+ if (noMoreActiveHolds && ((_interactionExtraMetr3 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr3 === void 0 ? void 0 : _interactionExtraMetr3.id) !== interactionId) {
922
+ // If it's not waiting for extra metrics to complete, finish the interaction as normal
999
923
  if (!activeSubmitted) {
1000
- var _getConfig17, _getConfig18;
924
+ var _getConfig10, _getConfig11, _getConfig12;
1001
925
  finishInteraction(interactionId, interaction, endTime);
1002
- if ((_getConfig17 = (0, _config.getConfig)()) !== null && _getConfig17 !== void 0 && (_getConfig17 = _getConfig17.extraSearchPageInteraction) !== null && _getConfig17 !== void 0 && _getConfig17.enabled && interaction.ufoName === ((_getConfig18 = (0, _config.getConfig)()) === null || _getConfig18 === void 0 || (_getConfig18 = _getConfig18.extraSearchPageInteraction) === null || _getConfig18 === void 0 ? void 0 : _getConfig18.searchPageMetricName)) {
926
+ if ((_getConfig10 = (0, _config.getConfig)()) !== null && _getConfig10 !== void 0 && (_getConfig10 = _getConfig10.extraInteractionMetrics) !== null && _getConfig10 !== void 0 && _getConfig10.enabled) {
927
+ interactionExtraMetrics.updateFinishedInteraction(interaction);
928
+ }
929
+ if ((_getConfig11 = (0, _config.getConfig)()) !== null && _getConfig11 !== void 0 && (_getConfig11 = _getConfig11.extraSearchPageInteraction) !== null && _getConfig11 !== void 0 && _getConfig11.enabled && interaction.ufoName === ((_getConfig12 = (0, _config.getConfig)()) === null || _getConfig12 === void 0 || (_getConfig12 = _getConfig12.extraSearchPageInteraction) === null || _getConfig12 === void 0 ? void 0 : _getConfig12.searchPageMetricName)) {
1003
930
  (0, _createExtraSearchPageInteractionPayload.onSearchPageInteractionComplete)(interactionId, interaction);
1004
931
  }
1005
932
  activeSubmitted = true;
1006
933
  }
1007
934
  if (noMoreExpHolds) {
1008
- var _getConfig19;
1009
- if ((_getConfig19 = (0, _config.getConfig)()) !== null && _getConfig19 !== void 0 && (_getConfig19 = _getConfig19.experimentalInteractionMetrics) !== null && _getConfig19 !== void 0 && _getConfig19.enabled) {
935
+ var _getConfig13;
936
+ if ((_getConfig13 = (0, _config.getConfig)()) !== null && _getConfig13 !== void 0 && (_getConfig13 = _getConfig13.experimentalInteractionMetrics) !== null && _getConfig13 !== void 0 && _getConfig13.enabled) {
1010
937
  (0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime);
1011
938
  }
1012
939
  postInteraction();
1013
940
  }
1014
941
  }
942
+ if (noMoreActiveHolds && noMoreActive3pHolds) {
943
+ var _data2 = _objectSpread(_objectSpread({}, interaction), {}, {
944
+ end: endTime
945
+ });
946
+ interactionExtraMetrics.onInteractionComplete(interactionId, _data2);
947
+ }
1015
948
  }
1016
949
  }
1017
950
  }
@@ -1034,9 +967,7 @@ function abort(interactionId, abortReason) {
1034
967
  finishInteraction(interactionId, interaction, endTime);
1035
968
  postInteractionLog.reset();
1036
969
  postInteractionLog.stopVCObserver();
1037
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
1038
- interactionExtraMetrics.stopAll(interactionId);
1039
- }
970
+ interactionExtraMetrics.stopAll(interactionId);
1040
971
  if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(interaction.ufoName, interaction.type))) {
1041
972
  (0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime);
1042
973
  remove(interactionId);
@@ -1048,9 +979,7 @@ function abort(interactionId, abortReason) {
1048
979
  finishInteraction(interactionId, interaction);
1049
980
  postInteractionLog.reset();
1050
981
  postInteractionLog.stopVCObserver();
1051
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
1052
- interactionExtraMetrics.stopAll(interactionId);
1053
- }
982
+ interactionExtraMetrics.stopAll(interactionId);
1054
983
  if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(interaction.ufoName, interaction.type))) {
1055
984
  (0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction);
1056
985
  remove(interactionId);
@@ -1072,9 +1001,7 @@ function abortByNewInteraction(interactionId, interactionName) {
1072
1001
  finishInteraction(interactionId, interaction, endTime);
1073
1002
  postInteractionLog.reset();
1074
1003
  postInteractionLog.stopVCObserver();
1075
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
1076
- interactionExtraMetrics.stopAll(interactionId);
1077
- }
1004
+ interactionExtraMetrics.stopAll(interactionId);
1078
1005
  if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(interaction.ufoName, interaction.type))) {
1079
1006
  (0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime);
1080
1007
  remove(interactionId);
@@ -1087,9 +1014,7 @@ function abortByNewInteraction(interactionId, interactionName) {
1087
1014
  finishInteraction(interactionId, interaction);
1088
1015
  postInteractionLog.reset();
1089
1016
  postInteractionLog.stopVCObserver();
1090
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
1091
- interactionExtraMetrics.stopAll(interactionId);
1092
- }
1017
+ interactionExtraMetrics.stopAll(interactionId);
1093
1018
  if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(interaction.ufoName, interaction.type))) {
1094
1019
  (0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction);
1095
1020
  remove(interactionId);
@@ -1108,7 +1033,7 @@ function abortAll(abortReason, abortedByInteractionName) {
1108
1033
  _constants.interactions.forEach(function (interaction, interactionId) {
1109
1034
  var isActiveInteraction = activeInteraction === interaction;
1110
1035
  var hasFinished = interaction.holdActive.size === 0;
1111
- if (isActiveInteraction && abortReason === 'transition' && interaction.type === 'press' && finishInteractions !== null && finishInteractions !== void 0 && finishInteractions.includes(interaction.ufoName) && (0, _platformFeatureFlags.fg)('platform_ufo_enable_finish_interaction_transition')) {
1036
+ if (isActiveInteraction && abortReason === 'transition' && interaction.type === 'press' && finishInteractions !== null && finishInteractions !== void 0 && finishInteractions.includes(interaction.ufoName)) {
1112
1037
  hasFinished = true;
1113
1038
  }
1114
1039
  var shouldUseRawDataThirdParty = (0, _config.shouldUseRawDataThirdPartyBehavior)(interaction.ufoName, interaction.type);
@@ -1122,9 +1047,7 @@ function abortAll(abortReason, abortedByInteractionName) {
1122
1047
  finishInteraction(interactionId, interaction, endTime);
1123
1048
  postInteractionLog.reset();
1124
1049
  postInteractionLog.stopVCObserver();
1125
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
1126
- interactionExtraMetrics.stopAll(interactionId);
1127
- }
1050
+ interactionExtraMetrics.stopAll(interactionId);
1128
1051
  if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(interaction.ufoName, interaction.type))) {
1129
1052
  (0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime);
1130
1053
  remove(interactionId);
@@ -1141,9 +1064,7 @@ function abortAll(abortReason, abortedByInteractionName) {
1141
1064
  finishInteraction(interactionId, interaction);
1142
1065
  postInteractionLog.reset();
1143
1066
  postInteractionLog.stopVCObserver();
1144
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
1145
- interactionExtraMetrics.stopAll(interactionId);
1146
- }
1067
+ interactionExtraMetrics.stopAll(interactionId);
1147
1068
  if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(interaction.ufoName, interaction.type))) {
1148
1069
  (0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction);
1149
1070
  remove(interactionId);
@@ -1274,7 +1195,7 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
1274
1195
  addHoldByID(interactionId, [], ufoName, ufoName, true);
1275
1196
  }
1276
1197
  if (type === 'transition' || type === 'page_load') {
1277
- var _getConfig20, _config$extraInteract;
1198
+ var _getConfig14, _config$extraInteract;
1278
1199
  // Use per-interaction VC observer if available, otherwise fall back to global
1279
1200
  var observer = vcObserver;
1280
1201
  if (observer) {
@@ -1285,7 +1206,7 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
1285
1206
  }
1286
1207
  // Start post interaction observer for all if config is enabled
1287
1208
  // in case ufoName is updated at later time
1288
- if ((_getConfig20 = (0, _config.getConfig)()) !== null && _getConfig20 !== void 0 && (_getConfig20 = _getConfig20.postInteractionLog) !== null && _getConfig20 !== void 0 && _getConfig20.enabled) {
1209
+ if ((_getConfig14 = (0, _config.getConfig)()) !== null && _getConfig14 !== void 0 && (_getConfig14 = _getConfig14.postInteractionLog) !== null && _getConfig14 !== void 0 && _getConfig14.enabled) {
1289
1210
  postInteractionLog.startVCObserver({
1290
1211
  startTime: startTime
1291
1212
  });
@@ -1295,7 +1216,7 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
1295
1216
  startTime: startTime
1296
1217
  });
1297
1218
  }
1298
- if (config !== null && config !== void 0 && (_config$extraInteract = config.extraInteractionMetrics) !== null && _config$extraInteract !== void 0 && _config$extraInteract.enabled && (0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
1219
+ if (config !== null && config !== void 0 && (_config$extraInteract = config.extraInteractionMetrics) !== null && _config$extraInteract !== void 0 && _config$extraInteract.enabled) {
1299
1220
  interactionExtraMetrics.startVCObserver({
1300
1221
  startTime: startTime
1301
1222
  }, interactionId);
@@ -208,7 +208,7 @@ function init(analyticsWebClientAsync, config) {
208
208
  if ((_config$postInteracti = config.postInteractionLog) !== null && _config$postInteracti !== void 0 && _config$postInteracti.enabled) {
209
209
  sinkPostInteractionLog(instance, createPostInteractionLogPayloadPackage.default);
210
210
  }
211
- if (config !== null && config !== void 0 && (_config$extraInteract2 = config.extraInteractionMetrics) !== null && _config$extraInteract2 !== void 0 && _config$extraInteract2.enabled && (0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
211
+ if (config !== null && config !== void 0 && (_config$extraInteract2 = config.extraInteractionMetrics) !== null && _config$extraInteract2 !== void 0 && _config$extraInteract2.enabled) {
212
212
  sinkInteractionExtraMetrics(instance, createInteractionExtraMetricsPayloadPackage.default);
213
213
  }
214
214
  if (config !== null && config !== void 0 && (_config$extraSearchPa = config.extraSearchPageInteraction) !== null && _config$extraSearchPa !== void 0 && _config$extraSearchPa.enabled) {
@@ -227,7 +227,7 @@ function init(analyticsWebClientAsync, config) {
227
227
  if ((_config$postInteracti2 = config.postInteractionLog) !== null && _config$postInteracti2 !== void 0 && _config$postInteracti2.enabled) {
228
228
  sinkPostInteractionLog(awc, createPostInteractionLogPayloadPackage.default);
229
229
  }
230
- if (config !== null && config !== void 0 && (_config$extraInteract3 = config.extraInteractionMetrics) !== null && _config$extraInteract3 !== void 0 && _config$extraInteract3.enabled && (0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
230
+ if (config !== null && config !== void 0 && (_config$extraInteract3 = config.extraInteractionMetrics) !== null && _config$extraInteract3 !== void 0 && _config$extraInteract3.enabled) {
231
231
  sinkInteractionExtraMetrics(awc, createInteractionExtraMetricsPayloadPackage.default);
232
232
  }
233
233
  if (config !== null && config !== void 0 && (_config$extraSearchPa2 = config.extraSearchPageInteraction) !== null && _config$extraSearchPa2 !== void 0 && _config$extraSearchPa2.enabled) {
@@ -8,20 +8,13 @@ exports.UFOThirdPartySegment = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
- var _ignoreHolds = _interopRequireDefault(require("../ignore-holds"));
13
11
  var _segment = _interopRequireDefault(require("./segment"));
14
12
  var _excluded = ["children"];
15
13
  var UFOThirdPartySegment = exports.UFOThirdPartySegment = function UFOThirdPartySegment(props) {
16
14
  var children = props.children,
17
15
  otherProps = (0, _objectWithoutProperties2.default)(props, _excluded);
18
- return (0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p') ? /*#__PURE__*/_react.default.createElement(_segment.default, (0, _extends2.default)({
16
+ return /*#__PURE__*/_react.default.createElement(_segment.default, (0, _extends2.default)({
19
17
  type: "third-party"
20
- }, otherProps), children) : /*#__PURE__*/_react.default.createElement(_segment.default, (0, _extends2.default)({
21
- type: "third-party"
22
- }, otherProps), /*#__PURE__*/_react.default.createElement(_ignoreHolds.default, {
23
- ignore: (0, _platformFeatureFlags.fg)('platform_ufo_exclude_3p_elements_from_ttai'),
24
- reason: "third-party-element"
25
- }, children));
18
+ }, otherProps), children);
26
19
  };
27
20
  UFOThirdPartySegment.displayName = 'UFOThirdPartySegment';