@atlaskit/editor-synced-block-provider 8.3.1 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-synced-block-provider
2
2
 
3
+ ## 8.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`5e439884aa23d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5e439884aa23d) -
8
+ Add a readiness guard to the source synced-block cache-update path. When a `bodiedSyncBlock` node
9
+ is updated before its `localId`/`resourceId` has been populated (a benign timing/initialisation
10
+ ordering case), the cache update is now skipped as a no-op instead of throwing. This stops the
11
+ `Local ID or resource ID is not set` error from being logged and from firing the synced-block
12
+ update-cache operational error event, so it no longer counts as a genuine cache-update failure.
13
+ Gated behind `platform_editor_blocks_patch_4`.
14
+
3
15
  ## 8.3.1
4
16
 
5
17
  ### Patch Changes
@@ -123,6 +123,10 @@ var SourceSyncBlockStoreManager = exports.SourceSyncBlockStoreManager = /*#__PUR
123
123
  localId = _syncBlockNode$attrs.localId,
124
124
  resourceId = _syncBlockNode$attrs.resourceId;
125
125
  if (!localId || !resourceId) {
126
+ // Identifiers not populated yet: benign timing case, skip as a no-op.
127
+ if ((0, _platformFeatureFlags.fg)('platform_editor_blocks_patch_4')) {
128
+ return false;
129
+ }
126
130
  throw new Error('Local ID or resource ID is not set');
127
131
  }
128
132
  var cachedBlock = this.syncBlockCache.get(resourceId);
@@ -95,6 +95,10 @@ export class SourceSyncBlockStoreManager {
95
95
  resourceId
96
96
  } = syncBlockNode.attrs;
97
97
  if (!localId || !resourceId) {
98
+ // Identifiers not populated yet: benign timing case, skip as a no-op.
99
+ if (fg('platform_editor_blocks_patch_4')) {
100
+ return false;
101
+ }
98
102
  throw new Error('Local ID or resource ID is not set');
99
103
  }
100
104
  const cachedBlock = this.syncBlockCache.get(resourceId);
@@ -116,6 +116,10 @@ export var SourceSyncBlockStoreManager = /*#__PURE__*/function () {
116
116
  localId = _syncBlockNode$attrs.localId,
117
117
  resourceId = _syncBlockNode$attrs.resourceId;
118
118
  if (!localId || !resourceId) {
119
+ // Identifiers not populated yet: benign timing case, skip as a no-op.
120
+ if (fg('platform_editor_blocks_patch_4')) {
121
+ return false;
122
+ }
119
123
  throw new Error('Local ID or resource ID is not set');
120
124
  }
121
125
  var cachedBlock = this.syncBlockCache.get(resourceId);
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "@atlaskit/editor-prosemirror": "^8.0.0",
22
22
  "@atlaskit/node-data-provider": "^13.0.0",
23
23
  "@atlaskit/platform-feature-flags": "^2.0.0",
24
- "@atlaskit/tmp-editor-statsig": "^114.5.0",
24
+ "@atlaskit/tmp-editor-statsig": "^114.6.0",
25
25
  "@babel/runtime": "^7.0.0",
26
26
  "@compiled/react": "^0.20.0",
27
27
  "graphql-ws": "^5.14.2",
@@ -74,7 +74,7 @@
74
74
  }
75
75
  },
76
76
  "name": "@atlaskit/editor-synced-block-provider",
77
- "version": "8.3.1",
77
+ "version": "8.4.0",
78
78
  "description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
79
79
  "author": "Atlassian Pty Ltd",
80
80
  "license": "Apache-2.0",
@@ -88,6 +88,9 @@
88
88
  "platform_editor_blocks_patch_3": {
89
89
  "type": "boolean"
90
90
  },
91
+ "platform_editor_blocks_patch_4": {
92
+ "type": "boolean"
93
+ },
91
94
  "platform_synced_block_patch_13": {
92
95
  "type": "boolean"
93
96
  },