@atlaskit/collab-provider 15.3.23 → 15.3.24

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,13 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 15.3.24
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f29e3578dc7d1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f29e3578dc7d1) -
8
+ Use CollabDraftMetadata.relevance to conditionally run frontend catchup on ncs connected
9
+ - Updated dependencies
10
+
3
11
  ## 15.3.23
4
12
 
5
13
  ### Patch Changes
@@ -154,8 +154,14 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
154
154
  unconfirmedStepsLength: unconfirmedStepsLength
155
155
  }, _this.sessionId);
156
156
  } else if ((0, _expValEquals.expValEquals)('platform_editor_early_exit_return_draft', 'isEnabled', true)) {
157
- // need to the proactively catch up because CollabDraftQuery would return confluence draft which could be lacking behind the latest document state in NCS, and without this, the editor would be initialized with an outdated draft
158
- _this.documentService.throttledCatchupv2(_const.CatchupEventReason.PROCESS_STEPS);
157
+ var _this$initialDraft2;
158
+ // Conditionally run catchup based on CollabDraftMetadata.relevance
159
+ // Only catch up when relevance is 'STALE' or absent
160
+ // Skip catchup when relevance is 'LATEST' (draft is up-to-date)
161
+ var relevance = (_this$initialDraft2 = _this.initialDraft) === null || _this$initialDraft2 === void 0 || (_this$initialDraft2 = _this$initialDraft2.metadata) === null || _this$initialDraft2 === void 0 ? void 0 : _this$initialDraft2.relevance;
162
+ if (relevance === 'STALE' || relevance === undefined) {
163
+ _this.documentService.throttledCatchupv2(_const.CatchupEventReason.PROCESS_STEPS);
164
+ }
159
165
  }
160
166
  _this.participantsService.startInactiveRemover(_this.sessionId);
161
167
  if (_this.config.batchProps) {
@@ -485,10 +491,10 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
485
491
  });
486
492
  if (this.isBufferingEnabled && this.initialDraft && !this.isProviderInitialized) {
487
493
  var _this$analyticsHelper6;
488
- var _this$initialDraft2 = this.initialDraft,
489
- document = _this$initialDraft2.document,
490
- version = _this$initialDraft2.version,
491
- metadata = _this$initialDraft2.metadata;
494
+ var _this$initialDraft3 = this.initialDraft,
495
+ document = _this$initialDraft3.document,
496
+ version = _this$initialDraft3.version,
497
+ metadata = _this$initialDraft3.metadata;
492
498
  this.updateDocumentAndMetadata({
493
499
  doc: document,
494
500
  version: version,
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/collab-provider";
8
- var version = exports.version = "15.3.22";
8
+ var version = exports.version = "15.3.23";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -134,8 +134,14 @@ export class Provider extends Emitter {
134
134
  unconfirmedStepsLength: unconfirmedStepsLength
135
135
  }, this.sessionId);
136
136
  } else if (expValEquals('platform_editor_early_exit_return_draft', 'isEnabled', true)) {
137
- // need to the proactively catch up because CollabDraftQuery would return confluence draft which could be lacking behind the latest document state in NCS, and without this, the editor would be initialized with an outdated draft
138
- this.documentService.throttledCatchupv2(CatchupEventReason.PROCESS_STEPS);
137
+ var _this$initialDraft, _this$initialDraft$me;
138
+ // Conditionally run catchup based on CollabDraftMetadata.relevance
139
+ // Only catch up when relevance is 'STALE' or absent
140
+ // Skip catchup when relevance is 'LATEST' (draft is up-to-date)
141
+ const relevance = (_this$initialDraft = this.initialDraft) === null || _this$initialDraft === void 0 ? void 0 : (_this$initialDraft$me = _this$initialDraft.metadata) === null || _this$initialDraft$me === void 0 ? void 0 : _this$initialDraft$me.relevance;
142
+ if (relevance === 'STALE' || relevance === undefined) {
143
+ this.documentService.throttledCatchupv2(CatchupEventReason.PROCESS_STEPS);
144
+ }
139
145
  }
140
146
  this.participantsService.startInactiveRemover(this.sessionId);
141
147
  if (this.config.batchProps) {
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "15.3.22";
2
+ export const version = "15.3.23";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -148,8 +148,14 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
148
148
  unconfirmedStepsLength: unconfirmedStepsLength
149
149
  }, _this.sessionId);
150
150
  } else if (expValEquals('platform_editor_early_exit_return_draft', 'isEnabled', true)) {
151
- // need to the proactively catch up because CollabDraftQuery would return confluence draft which could be lacking behind the latest document state in NCS, and without this, the editor would be initialized with an outdated draft
152
- _this.documentService.throttledCatchupv2(CatchupEventReason.PROCESS_STEPS);
151
+ var _this$initialDraft2;
152
+ // Conditionally run catchup based on CollabDraftMetadata.relevance
153
+ // Only catch up when relevance is 'STALE' or absent
154
+ // Skip catchup when relevance is 'LATEST' (draft is up-to-date)
155
+ var relevance = (_this$initialDraft2 = _this.initialDraft) === null || _this$initialDraft2 === void 0 || (_this$initialDraft2 = _this$initialDraft2.metadata) === null || _this$initialDraft2 === void 0 ? void 0 : _this$initialDraft2.relevance;
156
+ if (relevance === 'STALE' || relevance === undefined) {
157
+ _this.documentService.throttledCatchupv2(CatchupEventReason.PROCESS_STEPS);
158
+ }
153
159
  }
154
160
  _this.participantsService.startInactiveRemover(_this.sessionId);
155
161
  if (_this.config.batchProps) {
@@ -479,10 +485,10 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
479
485
  });
480
486
  if (this.isBufferingEnabled && this.initialDraft && !this.isProviderInitialized) {
481
487
  var _this$analyticsHelper6;
482
- var _this$initialDraft2 = this.initialDraft,
483
- document = _this$initialDraft2.document,
484
- version = _this$initialDraft2.version,
485
- metadata = _this$initialDraft2.metadata;
488
+ var _this$initialDraft3 = this.initialDraft,
489
+ document = _this$initialDraft3.document,
490
+ version = _this$initialDraft3.version,
491
+ metadata = _this$initialDraft3.metadata;
486
492
  this.updateDocumentAndMetadata({
487
493
  doc: document,
488
494
  version: version,
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "15.3.22";
2
+ export var version = "15.3.23";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "15.3.23",
3
+ "version": "15.3.24",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/platform-feature-flags": "^1.1.0",
38
38
  "@atlaskit/prosemirror-collab": "^0.22.0",
39
39
  "@atlaskit/react-ufo": "^5.4.0",
40
- "@atlaskit/tmp-editor-statsig": "^35.0.0",
40
+ "@atlaskit/tmp-editor-statsig": "^35.2.0",
41
41
  "@atlaskit/ufo": "^0.4.0",
42
42
  "@atlaskit/util-service-support": "^6.3.0",
43
43
  "@babel/runtime": "^7.0.0",