@atlaskit/editor-synced-block-provider 6.5.2 → 6.6.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.
Files changed (206) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/blockService/ari/package.json +17 -0
  3. package/blockService/package.json +17 -0
  4. package/blockSubscription/package.json +17 -0
  5. package/clients/confluence/ari/package.json +5 -5
  6. package/common/types/package.json +5 -5
  7. package/dist/cjs/clients/jira/sourceInfo.js +63 -10
  8. package/dist/cjs/entry-points/blockService-ari.js +24 -0
  9. package/dist/cjs/entry-points/blockService.js +18 -0
  10. package/dist/cjs/entry-points/blockServiceAPI.js +54 -0
  11. package/dist/cjs/entry-points/blockSubscription.js +18 -0
  12. package/dist/cjs/entry-points/common-types.js +12 -0
  13. package/dist/cjs/entry-points/confluence-ari.js +18 -0
  14. package/dist/cjs/entry-points/errorHandling.js +12 -0
  15. package/dist/cjs/entry-points/fetchJiraMediaToken.js +12 -0
  16. package/dist/cjs/entry-points/fetchMediaToken.js +12 -0
  17. package/dist/cjs/entry-points/jira-ari.js +18 -0
  18. package/dist/cjs/entry-points/providers-types.js +1 -0
  19. package/dist/cjs/entry-points/rebaseTransaction.js +12 -0
  20. package/dist/cjs/entry-points/referenceSyncBlockStoreManager.js +12 -0
  21. package/dist/cjs/entry-points/requestJiraIssueAccess.js +12 -0
  22. package/dist/cjs/entry-points/resolveSyncBlockInstance.js +12 -0
  23. package/dist/cjs/entry-points/resourceId.js +18 -0
  24. package/dist/cjs/entry-points/sourceInfo.js +12 -0
  25. package/dist/cjs/entry-points/syncBlockInMemorySessionCache.js +18 -0
  26. package/dist/cjs/entry-points/syncBlockProvider.js +18 -0
  27. package/dist/cjs/entry-points/syncBlockStoreManager.js +18 -0
  28. package/dist/cjs/entry-points/tokenRouting.js +18 -0
  29. package/dist/cjs/entry-points/useFetchSyncBlockData.js +12 -0
  30. package/dist/cjs/entry-points/useFetchSyncBlockTitle.js +12 -0
  31. package/dist/cjs/entry-points/useHandleContentChanges.js +12 -0
  32. package/dist/cjs/entry-points/utils.js +60 -0
  33. package/dist/cjs/entry-points/validValue.js +18 -0
  34. package/dist/cjs/hooks/useFetchSyncBlockData.js +1 -1
  35. package/dist/cjs/providers/types.js +6 -0
  36. package/dist/cjs/store-manager/referenceSyncBlockStoreManager.js +24 -12
  37. package/dist/cjs/store-manager/sourceSyncBlockStoreManager.js +18 -15
  38. package/dist/cjs/store-manager/syncBlockBatchFetcher.js +1 -1
  39. package/dist/cjs/store-manager/syncBlockProviderFactoryManager.js +6 -4
  40. package/dist/cjs/store-manager/syncBlockStoreManager.js +2 -1
  41. package/dist/cjs/store-manager/syncBlockSubscriptionManager.js +9 -5
  42. package/dist/cjs/utils/errorHandling.js +41 -26
  43. package/dist/cjs/utils/resolveSyncBlockInstance.js +11 -10
  44. package/dist/cjs/utils/utils.js +30 -2
  45. package/dist/es2019/clients/jira/sourceInfo.js +64 -4
  46. package/dist/es2019/entry-points/blockService-ari.js +2 -0
  47. package/dist/es2019/entry-points/blockService.js +2 -0
  48. package/dist/es2019/entry-points/blockServiceAPI.js +2 -0
  49. package/dist/es2019/entry-points/blockSubscription.js +2 -0
  50. package/dist/es2019/entry-points/common-types.js +2 -0
  51. package/dist/es2019/entry-points/confluence-ari.js +2 -0
  52. package/dist/es2019/entry-points/errorHandling.js +2 -0
  53. package/dist/es2019/entry-points/fetchJiraMediaToken.js +2 -0
  54. package/dist/es2019/entry-points/fetchMediaToken.js +2 -0
  55. package/dist/es2019/entry-points/jira-ari.js +2 -0
  56. package/dist/es2019/entry-points/providers-types.js +0 -0
  57. package/dist/es2019/entry-points/rebaseTransaction.js +2 -0
  58. package/dist/es2019/entry-points/referenceSyncBlockStoreManager.js +2 -0
  59. package/dist/es2019/entry-points/requestJiraIssueAccess.js +2 -0
  60. package/dist/es2019/entry-points/resolveSyncBlockInstance.js +2 -0
  61. package/dist/es2019/entry-points/resourceId.js +2 -0
  62. package/dist/es2019/entry-points/sourceInfo.js +2 -0
  63. package/dist/es2019/entry-points/syncBlockInMemorySessionCache.js +2 -0
  64. package/dist/es2019/entry-points/syncBlockProvider.js +2 -0
  65. package/dist/es2019/entry-points/syncBlockStoreManager.js +2 -0
  66. package/dist/es2019/entry-points/tokenRouting.js +2 -0
  67. package/dist/es2019/entry-points/useFetchSyncBlockData.js +2 -0
  68. package/dist/es2019/entry-points/useFetchSyncBlockTitle.js +2 -0
  69. package/dist/es2019/entry-points/useHandleContentChanges.js +2 -0
  70. package/dist/es2019/entry-points/utils.js +2 -0
  71. package/dist/es2019/entry-points/validValue.js +2 -0
  72. package/dist/es2019/hooks/useFetchSyncBlockData.js +2 -2
  73. package/dist/es2019/providers/syncBlockProvider.js +4 -2
  74. package/dist/es2019/providers/types.js +7 -0
  75. package/dist/es2019/store-manager/referenceSyncBlockStoreManager.js +25 -13
  76. package/dist/es2019/store-manager/sourceSyncBlockStoreManager.js +19 -16
  77. package/dist/es2019/store-manager/syncBlockBatchFetcher.js +2 -2
  78. package/dist/es2019/store-manager/syncBlockProviderFactoryManager.js +6 -4
  79. package/dist/es2019/store-manager/syncBlockStoreManager.js +2 -1
  80. package/dist/es2019/store-manager/syncBlockSubscriptionManager.js +9 -5
  81. package/dist/es2019/utils/errorHandling.js +33 -14
  82. package/dist/es2019/utils/resolveSyncBlockInstance.js +11 -10
  83. package/dist/es2019/utils/utils.js +26 -0
  84. package/dist/esm/clients/jira/sourceInfo.js +63 -11
  85. package/dist/esm/entry-points/blockService-ari.js +2 -0
  86. package/dist/esm/entry-points/blockService.js +2 -0
  87. package/dist/esm/entry-points/blockServiceAPI.js +2 -0
  88. package/dist/esm/entry-points/blockSubscription.js +2 -0
  89. package/dist/esm/entry-points/common-types.js +2 -0
  90. package/dist/esm/entry-points/confluence-ari.js +2 -0
  91. package/dist/esm/entry-points/errorHandling.js +2 -0
  92. package/dist/esm/entry-points/fetchJiraMediaToken.js +2 -0
  93. package/dist/esm/entry-points/fetchMediaToken.js +2 -0
  94. package/dist/esm/entry-points/jira-ari.js +2 -0
  95. package/dist/esm/entry-points/providers-types.js +0 -0
  96. package/dist/esm/entry-points/rebaseTransaction.js +2 -0
  97. package/dist/esm/entry-points/referenceSyncBlockStoreManager.js +2 -0
  98. package/dist/esm/entry-points/requestJiraIssueAccess.js +2 -0
  99. package/dist/esm/entry-points/resolveSyncBlockInstance.js +2 -0
  100. package/dist/esm/entry-points/resourceId.js +2 -0
  101. package/dist/esm/entry-points/sourceInfo.js +2 -0
  102. package/dist/esm/entry-points/syncBlockInMemorySessionCache.js +2 -0
  103. package/dist/esm/entry-points/syncBlockProvider.js +2 -0
  104. package/dist/esm/entry-points/syncBlockStoreManager.js +2 -0
  105. package/dist/esm/entry-points/tokenRouting.js +2 -0
  106. package/dist/esm/entry-points/useFetchSyncBlockData.js +2 -0
  107. package/dist/esm/entry-points/useFetchSyncBlockTitle.js +2 -0
  108. package/dist/esm/entry-points/useHandleContentChanges.js +2 -0
  109. package/dist/esm/entry-points/utils.js +2 -0
  110. package/dist/esm/entry-points/validValue.js +2 -0
  111. package/dist/esm/hooks/useFetchSyncBlockData.js +2 -2
  112. package/dist/esm/providers/types.js +7 -0
  113. package/dist/esm/store-manager/referenceSyncBlockStoreManager.js +25 -13
  114. package/dist/esm/store-manager/sourceSyncBlockStoreManager.js +19 -16
  115. package/dist/esm/store-manager/syncBlockBatchFetcher.js +2 -2
  116. package/dist/esm/store-manager/syncBlockProviderFactoryManager.js +6 -4
  117. package/dist/esm/store-manager/syncBlockStoreManager.js +2 -1
  118. package/dist/esm/store-manager/syncBlockSubscriptionManager.js +9 -5
  119. package/dist/esm/utils/errorHandling.js +41 -26
  120. package/dist/esm/utils/resolveSyncBlockInstance.js +11 -10
  121. package/dist/esm/utils/utils.js +29 -1
  122. package/dist/types/clients/jira/sourceInfo.d.ts +20 -0
  123. package/dist/types/common/types.d.ts +2 -1
  124. package/dist/types/entry-points/blockService-ari.d.ts +1 -0
  125. package/dist/types/entry-points/blockService.d.ts +2 -0
  126. package/dist/types/entry-points/blockServiceAPI.d.ts +1 -0
  127. package/dist/types/entry-points/blockSubscription.d.ts +1 -0
  128. package/dist/types/entry-points/common-types.d.ts +2 -0
  129. package/dist/types/entry-points/confluence-ari.d.ts +1 -0
  130. package/dist/types/entry-points/errorHandling.d.ts +1 -0
  131. package/dist/types/entry-points/fetchJiraMediaToken.d.ts +1 -0
  132. package/dist/types/entry-points/fetchMediaToken.d.ts +2 -0
  133. package/dist/types/entry-points/jira-ari.d.ts +1 -0
  134. package/dist/types/entry-points/providers-types.d.ts +1 -0
  135. package/dist/types/entry-points/rebaseTransaction.d.ts +1 -0
  136. package/dist/types/entry-points/referenceSyncBlockStoreManager.d.ts +1 -0
  137. package/dist/types/entry-points/requestJiraIssueAccess.d.ts +2 -0
  138. package/dist/types/entry-points/resolveSyncBlockInstance.d.ts +1 -0
  139. package/dist/types/entry-points/resourceId.d.ts +1 -0
  140. package/dist/types/entry-points/sourceInfo.d.ts +1 -0
  141. package/dist/types/entry-points/syncBlockInMemorySessionCache.d.ts +1 -0
  142. package/dist/types/entry-points/syncBlockProvider.d.ts +1 -0
  143. package/dist/types/entry-points/syncBlockStoreManager.d.ts +1 -0
  144. package/dist/types/entry-points/tokenRouting.d.ts +1 -0
  145. package/dist/types/entry-points/useFetchSyncBlockData.d.ts +2 -0
  146. package/dist/types/entry-points/useFetchSyncBlockTitle.d.ts +1 -0
  147. package/dist/types/entry-points/useHandleContentChanges.d.ts +1 -0
  148. package/dist/types/entry-points/utils.d.ts +1 -0
  149. package/dist/types/entry-points/validValue.d.ts +1 -0
  150. package/dist/types/providers/types.d.ts +17 -0
  151. package/dist/types/utils/errorHandling.d.ts +13 -12
  152. package/dist/types/utils/utils.d.ts +3 -1
  153. package/dist/types-ts4.5/clients/jira/sourceInfo.d.ts +20 -0
  154. package/dist/types-ts4.5/common/types.d.ts +2 -1
  155. package/dist/types-ts4.5/entry-points/blockService-ari.d.ts +1 -0
  156. package/dist/types-ts4.5/entry-points/blockService.d.ts +2 -0
  157. package/dist/types-ts4.5/entry-points/blockServiceAPI.d.ts +1 -0
  158. package/dist/types-ts4.5/entry-points/blockSubscription.d.ts +1 -0
  159. package/dist/types-ts4.5/entry-points/common-types.d.ts +2 -0
  160. package/dist/types-ts4.5/entry-points/confluence-ari.d.ts +1 -0
  161. package/dist/types-ts4.5/entry-points/errorHandling.d.ts +1 -0
  162. package/dist/types-ts4.5/entry-points/fetchJiraMediaToken.d.ts +1 -0
  163. package/dist/types-ts4.5/entry-points/fetchMediaToken.d.ts +2 -0
  164. package/dist/types-ts4.5/entry-points/jira-ari.d.ts +1 -0
  165. package/dist/types-ts4.5/entry-points/providers-types.d.ts +1 -0
  166. package/dist/types-ts4.5/entry-points/rebaseTransaction.d.ts +1 -0
  167. package/dist/types-ts4.5/entry-points/referenceSyncBlockStoreManager.d.ts +1 -0
  168. package/dist/types-ts4.5/entry-points/requestJiraIssueAccess.d.ts +2 -0
  169. package/dist/types-ts4.5/entry-points/resolveSyncBlockInstance.d.ts +1 -0
  170. package/dist/types-ts4.5/entry-points/resourceId.d.ts +1 -0
  171. package/dist/types-ts4.5/entry-points/sourceInfo.d.ts +1 -0
  172. package/dist/types-ts4.5/entry-points/syncBlockInMemorySessionCache.d.ts +1 -0
  173. package/dist/types-ts4.5/entry-points/syncBlockProvider.d.ts +1 -0
  174. package/dist/types-ts4.5/entry-points/syncBlockStoreManager.d.ts +1 -0
  175. package/dist/types-ts4.5/entry-points/tokenRouting.d.ts +1 -0
  176. package/dist/types-ts4.5/entry-points/useFetchSyncBlockData.d.ts +2 -0
  177. package/dist/types-ts4.5/entry-points/useFetchSyncBlockTitle.d.ts +1 -0
  178. package/dist/types-ts4.5/entry-points/useHandleContentChanges.d.ts +1 -0
  179. package/dist/types-ts4.5/entry-points/utils.d.ts +1 -0
  180. package/dist/types-ts4.5/entry-points/validValue.d.ts +1 -0
  181. package/dist/types-ts4.5/providers/types.d.ts +17 -0
  182. package/dist/types-ts4.5/utils/errorHandling.d.ts +13 -12
  183. package/dist/types-ts4.5/utils/utils.d.ts +3 -1
  184. package/errorHandling/package.json +17 -0
  185. package/fetchJiraMediaToken/package.json +5 -5
  186. package/fetchMediaToken/package.json +17 -0
  187. package/jira/ari/package.json +17 -0
  188. package/package.json +7 -4
  189. package/providers/block-service/blockServiceAPI/package.json +5 -5
  190. package/providers/types/package.json +5 -5
  191. package/rebaseTransaction/package.json +17 -0
  192. package/referenceSyncBlockStoreManager/package.json +17 -0
  193. package/requestJiraIssueAccess/package.json +5 -5
  194. package/resolveSyncBlockInstance/package.json +17 -0
  195. package/sourceInfo/package.json +17 -0
  196. package/syncBlockInMemorySessionCache/package.json +17 -0
  197. package/syncBlockProvider/package.json +17 -0
  198. package/syncBlockStoreManager/package.json +17 -0
  199. package/tokenRouting/package.json +5 -5
  200. package/types/package.json +17 -0
  201. package/useFetchSyncBlockData/package.json +17 -0
  202. package/useFetchSyncBlockTitle/package.json +17 -0
  203. package/useHandleContentChanges/package.json +17 -0
  204. package/utils/package.json +17 -0
  205. package/utils/resourceId/package.json +5 -5
  206. package/validValue/package.json +17 -0
@@ -22,7 +22,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
22
22
  * @returns A merged SyncBlockInstance object.
23
23
  */
24
24
  var resolveSyncBlockInstance = exports.resolveSyncBlockInstance = function resolveSyncBlockInstance(oldResult, newResult) {
25
- var _newResult$data, _oldResult$data, _newResult$data2, _oldResult$data2, _newResult$data3, _oldResult$data3;
25
+ var _newResult$data, _oldResult$data, _newResult$data2, _oldResult$data2, _newResult$data3, _oldResult$data3, _newResult$data4, _oldResult$data4;
26
26
  // if the old result has no data, we simply return the new result
27
27
  if (!oldResult.data) {
28
28
  return newResult;
@@ -42,29 +42,30 @@ var resolveSyncBlockInstance = exports.resolveSyncBlockInstance = function resol
42
42
  sourceURL: ((_newResult$data = newResult.data) === null || _newResult$data === void 0 ? void 0 : _newResult$data.sourceURL) || ((_oldResult$data = oldResult.data) === null || _oldResult$data === void 0 ? void 0 : _oldResult$data.sourceURL) || undefined,
43
43
  sourceTitle: ((_newResult$data2 = newResult.data) === null || _newResult$data2 === void 0 ? void 0 : _newResult$data2.sourceTitle) || ((_oldResult$data2 = oldResult.data) === null || _oldResult$data2 === void 0 ? void 0 : _oldResult$data2.sourceTitle) || undefined,
44
44
  sourceSubType: mergeSubType(oldResult, newResult),
45
- onSameDocument: ((_newResult$data3 = newResult.data) === null || _newResult$data3 === void 0 ? void 0 : _newResult$data3.onSameDocument) || ((_oldResult$data3 = oldResult.data) === null || _oldResult$data3 === void 0 ? void 0 : _oldResult$data3.onSameDocument) || undefined
45
+ onSameDocument: ((_newResult$data3 = newResult.data) === null || _newResult$data3 === void 0 ? void 0 : _newResult$data3.onSameDocument) || ((_oldResult$data3 = oldResult.data) === null || _oldResult$data3 === void 0 ? void 0 : _oldResult$data3.onSameDocument) || undefined,
46
+ issueType: ((_newResult$data4 = newResult.data) === null || _newResult$data4 === void 0 ? void 0 : _newResult$data4.issueType) || ((_oldResult$data4 = oldResult.data) === null || _oldResult$data4 === void 0 ? void 0 : _oldResult$data4.issueType) || undefined
46
47
  })
47
48
  });
48
49
  };
49
50
  var mergeSubType = function mergeSubType(oldResult, newResult) {
50
- var _newResult$data4, _newResult$data5, _oldResult$data4;
51
+ var _newResult$data5, _newResult$data6, _oldResult$data5;
51
52
  // for classic pages, subType is 'null'
52
- if (((_newResult$data4 = newResult.data) === null || _newResult$data4 === void 0 ? void 0 : _newResult$data4.sourceSubType) !== undefined) {
53
+ if (((_newResult$data5 = newResult.data) === null || _newResult$data5 === void 0 ? void 0 : _newResult$data5.sourceSubType) !== undefined) {
53
54
  return newResult.data.sourceSubType;
54
55
  }
55
- if ((_newResult$data5 = newResult.data) !== null && _newResult$data5 !== void 0 && _newResult$data5.sourceAri) {
56
+ if ((_newResult$data6 = newResult.data) !== null && _newResult$data6 !== void 0 && _newResult$data6.sourceAri) {
56
57
  // for blogposts, subType is always undefined
57
58
  try {
58
- var _newResult$data6;
59
+ var _newResult$data7;
59
60
  var _getPageIdAndTypeFrom = (0, _ari.getPageIdAndTypeFromConfluencePageAri)({
60
- ari: (_newResult$data6 = newResult.data) === null || _newResult$data6 === void 0 ? void 0 : _newResult$data6.sourceAri
61
+ ari: (_newResult$data7 = newResult.data) === null || _newResult$data7 === void 0 ? void 0 : _newResult$data7.sourceAri
61
62
  }),
62
63
  pageType = _getPageIdAndTypeFrom.type;
63
64
  if (pageType === 'blogpost') {
64
- var _newResult$data7;
65
- return (_newResult$data7 = newResult.data) === null || _newResult$data7 === void 0 ? void 0 : _newResult$data7.sourceSubType;
65
+ var _newResult$data8;
66
+ return (_newResult$data8 = newResult.data) === null || _newResult$data8 === void 0 ? void 0 : _newResult$data8.sourceSubType;
66
67
  }
67
68
  } catch (_unused) {}
68
69
  }
69
- return (_oldResult$data4 = oldResult.data) === null || _oldResult$data4 === void 0 ? void 0 : _oldResult$data4.sourceSubType;
70
+ return (_oldResult$data5 = oldResult.data) === null || _oldResult$data5 === void 0 ? void 0 : _oldResult$data5.sourceSubType;
70
71
  };
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getContentIdAndProductFromResourceId = exports.createSyncBlockNode = exports.convertSyncBlockPMNodeToSyncBlockData = exports.convertSyncBlockJSONNodeToSyncBlockNode = exports.convertPMNodesToSyncBlockNodes = exports.convertPMNodeToSyncBlockNode = exports.convertContentUpdatedAt = void 0;
6
+ exports.productAttrIfGateOn = exports.getSourceProductFromResourceIdSafe = exports.getContentIdAndProductFromResourceId = exports.createSyncBlockNode = exports.convertSyncBlockPMNodeToSyncBlockData = exports.convertSyncBlockJSONNodeToSyncBlockNode = exports.convertPMNodesToSyncBlockNodes = exports.convertPMNodeToSyncBlockNode = exports.convertContentUpdatedAt = void 0;
7
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
7
8
  /* eslint-disable require-unicode-regexp */
8
9
 
9
10
  var convertSyncBlockPMNodeToSyncBlockData = exports.convertSyncBlockPMNodeToSyncBlockData = function convertSyncBlockPMNodeToSyncBlockData(node) {
@@ -58,11 +59,38 @@ var getContentIdAndProductFromResourceId = exports.getContentIdAndProductFromRes
58
59
  }
59
60
  throw new Error("Invalid resourceId: ".concat(resourceId));
60
61
  };
62
+
63
+ /*
64
+ * Safe variant of `getContentIdAndProductFromResourceId` for analytics call-sites.
65
+ * Returns `undefined` instead of throwing when the resourceId is missing or malformed,
66
+ * so a bad value can never break the analytics pipeline.
67
+ */
68
+ var getSourceProductFromResourceIdSafe = exports.getSourceProductFromResourceIdSafe = function getSourceProductFromResourceIdSafe(resourceId) {
69
+ if (!resourceId) {
70
+ return undefined;
71
+ }
72
+ try {
73
+ return getContentIdAndProductFromResourceId(resourceId).sourceProduct;
74
+ } catch (_unused) {
75
+ return undefined;
76
+ }
77
+ };
78
+
79
+ /*
80
+ * Convenience wrapper around `getSourceProductFromResourceIdSafe` that returns
81
+ * `undefined` whenever the `platform_synced_block_patch_11` rollout flag is off.
82
+ * Centralised so that the flag name lives in exactly one place — when the flag is
83
+ * cleaned up, this function should be deleted in its entirety and call-sites should
84
+ * fall back to calling `getSourceProductFromResourceIdSafe` directly.
85
+ */
86
+ var productAttrIfGateOn = exports.productAttrIfGateOn = function productAttrIfGateOn(resourceId) {
87
+ return (0, _platformFeatureFlags.fg)('platform_synced_block_patch_11') ? getSourceProductFromResourceIdSafe(resourceId) : undefined;
88
+ };
61
89
  var convertContentUpdatedAt = exports.convertContentUpdatedAt = function convertContentUpdatedAt(contentUpdatedAt) {
62
90
  if (typeof contentUpdatedAt === 'number') {
63
91
  try {
64
92
  return new Date(contentUpdatedAt).toISOString();
65
- } catch (_unused) {
93
+ } catch (_unused2) {
66
94
  return undefined;
67
95
  }
68
96
  }
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable require-unicode-regexp */
2
-
2
+ import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import { fetchWithRetry } from '../../utils/retry';
4
4
  const COMMON_HEADERS = {
5
5
  'Content-Type': 'application/json',
@@ -15,12 +15,22 @@ const GET_SOURCE_INFO_OPERATION_NAME = 'EDITOR_SYNCED_BLOCK_GET_SOURCE_INFO';
15
15
  * @param id - the ID of the work item
16
16
  * @returns url of the work item
17
17
  */
18
+ // `issueType` is requested unconditionally because GraphQL field selection cannot be
19
+ // gated at the network layer without a separate operation; AGG ignores unknown
20
+ // front-end gating. The runtime mapping into `SyncBlockSourceInfo.issueType` is gated
21
+ // by `platform_synced_block_patch_11` below.
18
22
  const GET_SOURCE_INFO_QUERY = `query ${GET_SOURCE_INFO_OPERATION_NAME} ($id: ID!) {
19
23
  jira {
20
24
  issueById(id: $id) {
21
25
  id
22
26
  webUrl
23
27
  summary
28
+ issueType {
29
+ name
30
+ avatar {
31
+ xsmall
32
+ }
33
+ }
24
34
  }
25
35
  }}`;
26
36
  const getJiraWorkItemSourceInfo = async ari => {
@@ -69,13 +79,63 @@ const resolveNoAccessWorkItemInfo = async ari => {
69
79
  throw new Error(`Failed to resolve ari: ${response.statusText}`);
70
80
  }
71
81
  };
82
+
83
+ /**
84
+ * Fetch source-info metadata for a Jira work item used by reference sync blocks.
85
+ *
86
+ * Parity notes vs the Confluence equivalent (`fetchConfluencePageInfo`):
87
+ *
88
+ * - **Archived / draft URL variants** are intentionally omitted. Confluence pages can be
89
+ * "unpublished" (draft, archived, in-trash) and need REST fallbacks plus alternate URL
90
+ * shapes. Jira work items have no equivalent lifecycle — an issue either exists in AGG
91
+ * or it does not — so a single `webUrl` is sufficient.
92
+ *
93
+ * - **`#block-{localId}` deep-link anchor** is intentionally not appended. The current
94
+ * Jira issue view does not implement scroll-to-anchor for unknown fragments, so the
95
+ * anchor would be dead weight on the URL. The dispatching code in
96
+ * `syncBlockProvider.fetchSyncBlockSourceInfo` deliberately does not pass `localId`
97
+ * here for the same reason. If/when Jira issue view supports anchor scrolling for
98
+ * sync-block local IDs, accept `localId?: string` here and append `#block-{localId}`.
99
+ *
100
+ * - **`subType` / page-type variants** are not modeled — Jira issue type is exposed via
101
+ * the separate `issueType` field returned alongside `summary` / `webUrl`.
102
+ */
72
103
  export const fetchJiraWorkItemInfo = async (workItemAri, hasAccess) => {
73
104
  if (hasAccess) {
74
- var _response$data, _response$data$jira;
105
+ var _response$data, _response$data$jira, _contentData$webUrl, _contentData$summary;
75
106
  const response = await getJiraWorkItemSourceInfo(workItemAri);
76
107
  const contentData = (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$jira = _response$data.jira) === null || _response$data$jira === void 0 ? void 0 : _response$data$jira.issueById;
77
- const webUrl = contentData === null || contentData === void 0 ? void 0 : contentData.webUrl;
78
- const summary = contentData === null || contentData === void 0 ? void 0 : contentData.summary;
108
+
109
+ // Defensive narrowing (gated by `platform_synced_block_patch_11`):
110
+ // AGG may return `null` (not just omit the field) for `webUrl` / `summary` on
111
+ // partially indexed issues. Without these guards, downstream consumers that
112
+ // expect `string | undefined` would receive `null` and either crash or render
113
+ // the literal string "null". The pre-gate path preserves the legacy behaviour
114
+ // so this can be dialled off independently.
115
+ if (fg('platform_synced_block_patch_11')) {
116
+ var _rawIssueType$avatar;
117
+ const webUrl = typeof (contentData === null || contentData === void 0 ? void 0 : contentData.webUrl) === 'string' ? contentData.webUrl : undefined;
118
+ const summary = typeof (contentData === null || contentData === void 0 ? void 0 : contentData.summary) === 'string' ? contentData.summary : undefined;
119
+
120
+ // Surface issue-type metadata so consumers can render the correct ADS issue-type
121
+ // icon. Defensive narrowing mirrors the webUrl/summary treatment above: only
122
+ // surfaced when `name` is a non-empty string; AGG values like `{ name: null }`
123
+ // collapse back to `undefined`.
124
+ const rawIssueType = contentData === null || contentData === void 0 ? void 0 : contentData.issueType;
125
+ const issueTypeName = typeof (rawIssueType === null || rawIssueType === void 0 ? void 0 : rawIssueType.name) === 'string' && rawIssueType.name.length > 0 ? rawIssueType.name : undefined;
126
+ const issueType = issueTypeName ? {
127
+ name: issueTypeName,
128
+ iconUrl: typeof (rawIssueType === null || rawIssueType === void 0 ? void 0 : (_rawIssueType$avatar = rawIssueType.avatar) === null || _rawIssueType$avatar === void 0 ? void 0 : _rawIssueType$avatar.xsmall) === 'string' ? rawIssueType.avatar.xsmall : undefined
129
+ } : undefined;
130
+ return Promise.resolve({
131
+ url: webUrl,
132
+ sourceAri: workItemAri,
133
+ title: summary,
134
+ issueType
135
+ });
136
+ }
137
+ const webUrl = (_contentData$webUrl = contentData === null || contentData === void 0 ? void 0 : contentData.webUrl) !== null && _contentData$webUrl !== void 0 ? _contentData$webUrl : undefined;
138
+ const summary = (_contentData$summary = contentData === null || contentData === void 0 ? void 0 : contentData.summary) !== null && _contentData$summary !== void 0 ? _contentData$summary : undefined;
79
139
  return Promise.resolve({
80
140
  url: webUrl,
81
141
  sourceAri: workItemAri,
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { generateBlockAri, generateBlockAriFromReference, getLocalIdFromBlockResourceId } from '../clients/block-service/ari';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { BlockError, updateSyncedBlocks } from '../clients/block-service/blockService';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { useMemoizedBlockServiceAPIProviders, useMemoizedBlockServiceFetchOnlyAPIProvider, fetchReferences, batchFetchData, writeDataBatch, blockAriToResourceId, convertToSyncBlockData, extractResourceIdFromBlockAri } from '../providers/block-service/blockServiceAPI';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { extractGraphQLWSErrorMessage, getConnectionDiagnosticsSummary } from '../clients/block-service/blockSubscription';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { SyncBlockError } from '../common/types';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { getConfluencePageAri, getPageIdAndTypeFromConfluencePageAri } from '../clients/confluence/ari';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { fetchErrorPayload } from '../utils/errorHandling';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { fetchJiraMediaToken } from '../clients/jira/fetchMediaToken';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { fetchMediaToken } from '../clients/confluence/fetchMediaToken';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { getJiraWorkItemAri, getJiraWorkItemIdFromAri } from '../clients/jira/ari';
File without changes
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { rebaseTransaction } from '../common/rebase-transaction';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { ReferenceSyncBlockStoreManager } from '../store-manager/referenceSyncBlockStoreManager';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { requestJiraSpaceAccess } from '../clients/jira/requestJiraIssueAccess';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { resolveSyncBlockInstance } from '../utils/resolveSyncBlockInstance';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { parseResourceId, createResourceIdForReference } from '../utils/resourceId';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { fetchConfluencePageInfo } from '../clients/confluence/sourceInfo';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { SyncBlockInMemorySessionCache, syncBlockInMemorySessionCache } from '../store-manager/syncBlockInMemorySessionCache';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { SyncedBlockProvider, useMemoizedSyncedBlockProvider } from '../providers/syncBlockProvider';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { SyncBlockStoreManager, useMemoizedSyncBlockStoreManager } from '../store-manager/syncBlockStoreManager';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { fetchTokenForSourceProduct, requiresCrossProductAuth } from '../clients/tokenRouting';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { useFetchSyncBlockData } from '../hooks/useFetchSyncBlockData';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { useFetchSyncBlockTitle } from '../hooks/useFetchSyncBlockTitle';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { useHandleContentChanges } from '../hooks/useHandleContentChanges';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { createSyncBlockNode, convertSyncBlockPMNodeToSyncBlockData, convertSyncBlockJSONNodeToSyncBlockNode, convertPMNodesToSyncBlockNodes, convertPMNodeToSyncBlockNode, convertContentUpdatedAt, getContentIdAndProductFromResourceId, getSourceProductFromResourceIdSafe, productAttrIfGateOn } from '../utils/utils';
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { normaliseSyncBlockProduct, normaliseSyncBlockStatus } from '../utils/validValue';
@@ -3,7 +3,7 @@ import { isSSR } from '@atlaskit/editor-common/core-utils';
3
3
  import { logException } from '@atlaskit/editor-common/monitoring';
4
4
  import { SyncBlockError } from '../common/types';
5
5
  import { fetchErrorPayload } from '../utils/errorHandling';
6
- import { createSyncBlockNode } from '../utils/utils';
6
+ import { createSyncBlockNode, productAttrIfGateOn } from '../utils/utils';
7
7
  export const useFetchSyncBlockData = (manager, resourceId, localId, fireAnalyticsEvent) => {
8
8
  // Initialize both states from a single cache lookup to avoid race conditions.
9
9
  // When a block is moved/remounted, the old component's cleanup may clear the cache
@@ -46,7 +46,7 @@ export const useFetchSyncBlockData = (manager, resourceId, localId, fireAnalytic
46
46
  logException(error, {
47
47
  location: 'editor-synced-block-provider/useFetchSyncBlockData'
48
48
  });
49
- fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 ? void 0 : fireAnalyticsEvent(fetchErrorPayload(error.message));
49
+ fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 ? void 0 : fireAnalyticsEvent(fetchErrorPayload(error.message, resourceId, productAttrIfGateOn(resourceId)));
50
50
 
51
51
  // Set error state if fetching fails
52
52
  setFetchState({
@@ -220,8 +220,10 @@ export class SyncedBlockProvider extends SyncBlockDataProviderInterface {
220
220
  var _this$writeProvider4;
221
221
  // Note: `subType`, archived URL handling, and `isUnpublished` are intentionally
222
222
  // omitted here — Jira work items have no equivalent page subtype or archived state.
223
- // The `localId` param is not forwarded because deep-linking to a specific block
224
- // within a Jira issue description is working as intended without it.
223
+ // The `localId` param is intentionally not forwarded: the current Jira issue view
224
+ // does not scroll to `#block-{localId}` anchors, so passing it would only pollute
225
+ // the URL. See the parity-notes JSDoc on `fetchJiraWorkItemInfo` for the full
226
+ // rationale and the conditions under which this should be revisited.
225
227
  const sourceInfo = await fetchJiraWorkItemInfo(ari, hasAccess);
226
228
  if (!sourceInfo) {
227
229
  return Promise.resolve(undefined);
@@ -6,6 +6,13 @@ import { NodeDataProvider } from '@atlaskit/node-data-provider';
6
6
  * This will be used in both data processing and rendering contexts.
7
7
  */
8
8
 
9
+ /**
10
+ * Lightweight metadata for a Jira issue's type, surfaced so consumers can render the
11
+ * correct ADS issue-type icon (Task / Bug / Story / Epic / Subtask) or fall back to the
12
+ * AGG-provided `iconUrl` for custom types. Optional throughout — Confluence references
13
+ * leave it `undefined`.
14
+ */
15
+
9
16
  /**
10
17
  * Configuration options for batch fetch operations
11
18
  */
@@ -6,7 +6,7 @@ import { SyncBlockError } from '../common/types';
6
6
  import { fetchErrorPayload, fetchSuccessPayload, getSourceInfoErrorPayload, updateReferenceErrorPayload } from '../utils/errorHandling';
7
7
  import { getFetchExperience, getFetchSourceInfoExperience, getSaveReferenceExperience } from '../utils/experienceTracking';
8
8
  import { resolveSyncBlockInstance } from '../utils/resolveSyncBlockInstance';
9
- import { createSyncBlockNode } from '../utils/utils';
9
+ import { createSyncBlockNode, getSourceProductFromResourceIdSafe, productAttrIfGateOn } from '../utils/utils';
10
10
  import { SyncBlockBatchFetcher } from './syncBlockBatchFetcher';
11
11
  import { syncBlockInMemorySessionCache } from './syncBlockInMemorySessionCache';
12
12
  import { SyncBlockProviderFactoryManager } from './syncBlockProviderFactoryManager';
@@ -218,7 +218,8 @@ export class ReferenceSyncBlockStoreManager {
218
218
  sourceURL,
219
219
  sourceTitle,
220
220
  onSameDocument,
221
- sourceSubType
221
+ sourceSubType,
222
+ issueType
222
223
  } = existingSyncBlock.data || {};
223
224
  // skip if source URL and title are already present
224
225
  if (sourceURL && sourceTitle) {
@@ -228,12 +229,18 @@ export class ReferenceSyncBlockStoreManager {
228
229
  subType: sourceSubType,
229
230
  sourceAri: sourceAri || '',
230
231
  onSameDocument,
231
- productType: product
232
+ productType: product,
233
+ issueType
232
234
  });
233
235
  }
236
+
237
+ // Derive once per call so we don't re-parse on every analytics event below.
238
+ // `product` from cached data is preferred when available; fall back to parsing
239
+ // the resourceId.
240
+ const sourceProduct = fg('platform_synced_block_patch_11') ? product !== null && product !== void 0 ? product : getSourceProductFromResourceIdSafe(resourceId) : undefined;
234
241
  if (!sourceAri || !product || !blockInstanceId) {
235
242
  var _this$fireAnalyticsEv3;
236
- (_this$fireAnalyticsEv3 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv3 === void 0 ? void 0 : _this$fireAnalyticsEv3.call(this, getSourceInfoErrorPayload('SourceAri, product or blockInstanceId missing', resourceId));
243
+ (_this$fireAnalyticsEv3 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv3 === void 0 ? void 0 : _this$fireAnalyticsEv3.call(this, getSourceInfoErrorPayload('SourceAri, product or blockInstanceId missing', resourceId, sourceProduct));
237
244
  return Promise.resolve(undefined);
238
245
  }
239
246
  (_this$fetchSourceInfo = this.fetchSourceInfoExperience) === null || _this$fetchSourceInfo === void 0 ? void 0 : _this$fetchSourceInfo.start({});
@@ -244,7 +251,7 @@ export class ReferenceSyncBlockStoreManager {
244
251
  (_this$fetchSourceInfo2 = this.fetchSourceInfoExperience) === null || _this$fetchSourceInfo2 === void 0 ? void 0 : _this$fetchSourceInfo2.failure({
245
252
  reason: 'No source info returned'
246
253
  });
247
- (_this$fireAnalyticsEv4 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv4 === void 0 ? void 0 : _this$fireAnalyticsEv4.call(this, getSourceInfoErrorPayload('No source info returned', resourceId));
254
+ (_this$fireAnalyticsEv4 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv4 === void 0 ? void 0 : _this$fireAnalyticsEv4.call(this, getSourceInfoErrorPayload('No source info returned', resourceId, sourceProduct));
248
255
  return undefined;
249
256
  }
250
257
  this.updateCacheWithSourceInfo(resourceId, sourceInfo);
@@ -259,7 +266,7 @@ export class ReferenceSyncBlockStoreManager {
259
266
  (_this$fetchSourceInfo4 = this.fetchSourceInfoExperience) === null || _this$fetchSourceInfo4 === void 0 ? void 0 : _this$fetchSourceInfo4.failure({
260
267
  reason: 'Missing title or url'
261
268
  });
262
- (_this$fireAnalyticsEv5 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv5 === void 0 ? void 0 : _this$fireAnalyticsEv5.call(this, getSourceInfoErrorPayload('Missing title or url', resourceId));
269
+ (_this$fireAnalyticsEv5 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv5 === void 0 ? void 0 : _this$fireAnalyticsEv5.call(this, getSourceInfoErrorPayload('Missing title or url', resourceId, sourceProduct));
263
270
  }
264
271
  return sourceInfo;
265
272
  }).catch(error => {
@@ -267,7 +274,7 @@ export class ReferenceSyncBlockStoreManager {
267
274
  (_this$fetchSourceInfo5 = this.fetchSourceInfoExperience) === null || _this$fetchSourceInfo5 === void 0 ? void 0 : _this$fetchSourceInfo5.failure({
268
275
  reason: error.message
269
276
  });
270
- (_this$fireAnalyticsEv6 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv6 === void 0 ? void 0 : _this$fireAnalyticsEv6.call(this, getSourceInfoErrorPayload(error.message, resourceId));
277
+ (_this$fireAnalyticsEv6 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv6 === void 0 ? void 0 : _this$fireAnalyticsEv6.call(this, getSourceInfoErrorPayload(error.message, resourceId, sourceProduct));
271
278
  return undefined;
272
279
  }).finally(() => {
273
280
  this.syncBlockSourceInfoRequests.delete(resourceId);
@@ -279,7 +286,7 @@ export class ReferenceSyncBlockStoreManager {
279
286
  logException(error, {
280
287
  location: 'editor-synced-block-provider/referenceSyncBlockStoreManager'
281
288
  });
282
- (_this$fireAnalyticsEv7 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv7 === void 0 ? void 0 : _this$fireAnalyticsEv7.call(this, getSourceInfoErrorPayload(error.message, resourceId));
289
+ (_this$fireAnalyticsEv7 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv7 === void 0 ? void 0 : _this$fireAnalyticsEv7.call(this, getSourceInfoErrorPayload(error.message, resourceId, productAttrIfGateOn(resourceId)));
283
290
  }
284
291
  return Promise.resolve(undefined);
285
292
  }
@@ -407,6 +414,7 @@ export class ReferenceSyncBlockStoreManager {
407
414
  if (!syncBlockInstance.resourceId) {
408
415
  var _syncBlockInstance$er, _syncBlockInstance$er2, _this$fireAnalyticsEv8;
409
416
  const payload = ((_syncBlockInstance$er = syncBlockInstance.error) === null || _syncBlockInstance$er === void 0 ? void 0 : _syncBlockInstance$er.reason) || ((_syncBlockInstance$er2 = syncBlockInstance.error) === null || _syncBlockInstance$er2 === void 0 ? void 0 : _syncBlockInstance$er2.type) || 'Returned sync block instance does not have resource id';
417
+ // No resourceId means we cannot derive a sourceProduct here; intentionally omit.
410
418
  (_this$fireAnalyticsEv8 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv8 === void 0 ? void 0 : _this$fireAnalyticsEv8.call(this, fetchErrorPayload(payload));
411
419
  return;
412
420
  }
@@ -425,8 +433,8 @@ export class ReferenceSyncBlockStoreManager {
425
433
  this.newlyAddedSyncBlocks.delete(syncBlockInstance.resourceId);
426
434
  }
427
435
  if (syncBlockInstance.error) {
428
- var _this$fireAnalyticsEv9;
429
- (_this$fireAnalyticsEv9 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv9 === void 0 ? void 0 : _this$fireAnalyticsEv9.call(this, fetchErrorPayload(syncBlockInstance.error.reason || syncBlockInstance.error.type, syncBlockInstance.resourceId));
436
+ var _this$fireAnalyticsEv9, _syncBlockInstance$da, _syncBlockInstance$da2;
437
+ (_this$fireAnalyticsEv9 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv9 === void 0 ? void 0 : _this$fireAnalyticsEv9.call(this, fetchErrorPayload(syncBlockInstance.error.reason || syncBlockInstance.error.type, syncBlockInstance.resourceId, fg('platform_synced_block_patch_11') ? (_syncBlockInstance$da = (_syncBlockInstance$da2 = syncBlockInstance.data) === null || _syncBlockInstance$da2 === void 0 ? void 0 : _syncBlockInstance$da2.product) !== null && _syncBlockInstance$da !== void 0 ? _syncBlockInstance$da : getSourceProductFromResourceIdSafe(syncBlockInstance.resourceId) : undefined));
430
438
  if (syncBlockInstance.error.type === SyncBlockError.NotFound || syncBlockInstance.error.type === SyncBlockError.Forbidden) {
431
439
  hasExpectedError = true;
432
440
  } else if (syncBlockInstance.error) {
@@ -437,8 +445,10 @@ export class ReferenceSyncBlockStoreManager {
437
445
  const callbacks = this._subscriptionManager.getSubscriptions().get(syncBlockInstance.resourceId);
438
446
  const localIds = callbacks ? Object.keys(callbacks) : [];
439
447
  localIds.forEach(localId => {
440
- var _this$fireAnalyticsEv0, _syncBlockInstance$da;
441
- (_this$fireAnalyticsEv0 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv0 === void 0 ? void 0 : _this$fireAnalyticsEv0.call(this, fetchSuccessPayload(syncBlockInstance.resourceId, localId, (_syncBlockInstance$da = syncBlockInstance.data) === null || _syncBlockInstance$da === void 0 ? void 0 : _syncBlockInstance$da.product));
448
+ var _this$fireAnalyticsEv0, _syncBlockInstance$da3, _syncBlockInstance$da4;
449
+ (_this$fireAnalyticsEv0 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv0 === void 0 ? void 0 : _this$fireAnalyticsEv0.call(this, fetchSuccessPayload(syncBlockInstance.resourceId, localId,
450
+ // Prefer cached product when available; fall back to parsing the resourceId.
451
+ fg('platform_synced_block_patch_11') ? (_syncBlockInstance$da3 = (_syncBlockInstance$da4 = syncBlockInstance.data) === null || _syncBlockInstance$da4 === void 0 ? void 0 : _syncBlockInstance$da4.product) !== null && _syncBlockInstance$da3 !== void 0 ? _syncBlockInstance$da3 : getSourceProductFromResourceIdSafe(syncBlockInstance.resourceId) : undefined));
442
452
  });
443
453
  this.fetchSyncBlockSourceInfo(resolvedSyncBlockInstance.resourceId);
444
454
  });
@@ -456,7 +466,8 @@ export class ReferenceSyncBlockStoreManager {
456
466
  sourceURL: sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.url,
457
467
  sourceTitle: sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.title,
458
468
  onSameDocument: sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.onSameDocument,
459
- sourceSubType: sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.subType
469
+ sourceSubType: sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.subType,
470
+ issueType: sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.issueType
460
471
  };
461
472
  this.updateCache(existingSyncBlock);
462
473
  }
@@ -629,6 +640,7 @@ export class ReferenceSyncBlockStoreManager {
629
640
  (_this$saveExperience3 = this.saveExperience) === null || _this$saveExperience3 === void 0 ? void 0 : _this$saveExperience3.failure({
630
641
  reason: error.message
631
642
  });
643
+ // No `resourceId` available in this catch — sourceProduct is intentionally omitted.
632
644
  (_this$fireAnalyticsEv11 = this.fireAnalyticsEvent) === null || _this$fireAnalyticsEv11 === void 0 ? void 0 : _this$fireAnalyticsEv11.call(this, updateReferenceErrorPayload(error.message));
633
645
  } finally {
634
646
  if (!success) {