@atlaskit/collab-provider 11.3.1 → 12.0.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 +14 -0
- package/afm-cc/tsconfig.json +3 -3
- package/dist/cjs/document/document-service.js +53 -65
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/document/document-service.js +73 -82
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/document/document-service.js +53 -65
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/document/document-service.d.ts +4 -4
- package/dist/types/document/interface-document-service.d.ts +20 -20
- package/dist/types/errors/internal-errors.d.ts +14 -14
- package/dist/types/errors/ncs-errors.d.ts +20 -20
- package/dist/types/helpers/const.d.ts +58 -58
- package/dist/types/helpers/utils.d.ts +4 -4
- package/dist/types/participants/participants-service.d.ts +4 -4
- package/dist/types/provider/commit-step.d.ts +7 -7
- package/dist/types/provider/index.d.ts +1 -1
- package/dist/types/types.d.ts +86 -86
- package/dist/types-ts4.5/document/document-service.d.ts +4 -4
- package/dist/types-ts4.5/document/interface-document-service.d.ts +20 -20
- package/dist/types-ts4.5/errors/internal-errors.d.ts +14 -14
- package/dist/types-ts4.5/errors/ncs-errors.d.ts +20 -20
- package/dist/types-ts4.5/helpers/const.d.ts +58 -58
- package/dist/types-ts4.5/helpers/utils.d.ts +4 -4
- package/dist/types-ts4.5/participants/participants-service.d.ts +4 -4
- package/dist/types-ts4.5/provider/commit-step.d.ts +7 -7
- package/dist/types-ts4.5/provider/index.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +86 -86
- package/package.json +6 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/collab-provider
|
|
2
2
|
|
|
3
|
+
## 12.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 11.3.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`0fdcb6f2f96fd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0fdcb6f2f96fd) -
|
|
14
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 11.3.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"declaration": true,
|
|
5
5
|
"target": "es5",
|
|
6
|
-
"composite": true,
|
|
7
6
|
"outDir": "../../../../../confluence/tsDist/@atlaskit__collab-provider",
|
|
8
|
-
"rootDir": "../"
|
|
7
|
+
"rootDir": "../",
|
|
8
|
+
"composite": true
|
|
9
9
|
},
|
|
10
10
|
"include": [
|
|
11
11
|
"../src/**/*.ts",
|
|
@@ -63,4 +63,4 @@
|
|
|
63
63
|
"path": "../../editor-common/afm-cc/tsconfig.json"
|
|
64
64
|
}
|
|
65
65
|
]
|
|
66
|
-
}
|
|
66
|
+
}
|
|
@@ -27,7 +27,6 @@ var _customErrors = require("../errors/custom-errors");
|
|
|
27
27
|
var _catchupv = require("./catchupv2");
|
|
28
28
|
var _stepQueueState = require("./step-queue-state");
|
|
29
29
|
var _getConflictChanges = require("./getConflictChanges");
|
|
30
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
31
30
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
32
31
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33
32
|
var CATCHUP_THROTTLE = 1 * 1000; // 1 second
|
|
@@ -361,7 +360,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
361
360
|
// Triggered when page recovery has emitted an 'init' event on a page client is currently connected to.
|
|
362
361
|
(0, _defineProperty2.default)(this, "onRestore", /*#__PURE__*/function () {
|
|
363
362
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(_ref6) {
|
|
364
|
-
var doc, version, metadata, targetClientId, unconfirmedSteps, currentState, useReconcile, _this$obfuscateStepsA, obfuscatedSteps, obfuscatedDoc, _this$
|
|
363
|
+
var doc, version, metadata, targetClientId, unconfirmedSteps, currentState, useReconcile, _this$obfuscateStepsA, obfuscatedSteps, obfuscatedDoc, _this$analyticsHelper15, _this$analyticsHelper11, _this$getState5, generatedDiffStepsResponse, generatedSteps, state, stepsToBeApplied, _this$analyticsHelper12, _this$analyticsHelper13, _this$analyticsHelper14, _this$analyticsHelper16, _this$analyticsHelper17;
|
|
365
364
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
366
365
|
while (1) switch (_context3.prev = _context3.next) {
|
|
367
366
|
case 0:
|
|
@@ -412,15 +411,13 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
412
411
|
if (unconfirmedSteps !== null && unconfirmedSteps !== void 0 && unconfirmedSteps.length) {
|
|
413
412
|
_this.applyLocalSteps(unconfirmedSteps);
|
|
414
413
|
}
|
|
415
|
-
_context3.next =
|
|
414
|
+
_context3.next = 34;
|
|
416
415
|
break;
|
|
417
416
|
case 18:
|
|
418
417
|
_context3.prev = 18;
|
|
419
418
|
_context3.t0 = _context3["catch"](13);
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
break;
|
|
423
|
-
}
|
|
419
|
+
// Extract generatedSteps from fetchReconcile response
|
|
420
|
+
// and apply them to the editor state.
|
|
424
421
|
_this.onErrorHandled({
|
|
425
422
|
message: "Content synced with your team's edits. You may want to check for conflicting edits that could override your changes.",
|
|
426
423
|
data: {
|
|
@@ -431,10 +428,10 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
431
428
|
}
|
|
432
429
|
});
|
|
433
430
|
useReconcile = false;
|
|
434
|
-
_context3.prev =
|
|
435
|
-
_context3.next =
|
|
431
|
+
_context3.prev = 22;
|
|
432
|
+
_context3.next = 25;
|
|
436
433
|
return _this.fetchGeneratedDiffSteps(JSON.stringify(currentState.content), 'fe-restore-fetch-generated-steps');
|
|
437
|
-
case
|
|
434
|
+
case 25:
|
|
438
435
|
generatedDiffStepsResponse = _context3.sent;
|
|
439
436
|
generatedSteps = generatedDiffStepsResponse.generatedSteps;
|
|
440
437
|
state = (_this$getState5 = _this.getState) === null || _this$getState5 === void 0 ? void 0 : _this$getState5.call(_this);
|
|
@@ -453,23 +450,14 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
453
450
|
});
|
|
454
451
|
}
|
|
455
452
|
}
|
|
456
|
-
_context3.next =
|
|
453
|
+
_context3.next = 34;
|
|
457
454
|
break;
|
|
458
|
-
case
|
|
459
|
-
_context3.prev =
|
|
460
|
-
_context3.t1 = _context3["catch"](
|
|
455
|
+
case 31:
|
|
456
|
+
_context3.prev = 31;
|
|
457
|
+
_context3.t1 = _context3["catch"](22);
|
|
461
458
|
(_this$analyticsHelper14 = _this.analyticsHelper) === null || _this$analyticsHelper14 === void 0 || _this$analyticsHelper14.sendErrorEvent(_context3.t1, "Error fetchGeneratedDiffSteps with steps-only mode");
|
|
462
|
-
case
|
|
463
|
-
|
|
464
|
-
break;
|
|
465
|
-
case 37:
|
|
466
|
-
(_this$analyticsHelper15 = _this.analyticsHelper) === null || _this$analyticsHelper15 === void 0 || _this$analyticsHelper15.sendErrorEvent(_context3.t0, "Error while onRestore with applyLocalSteps. Will fallback to fetchReconcile");
|
|
467
|
-
useReconcile = true;
|
|
468
|
-
// Feature flag disabled - fallback to full document reconcile
|
|
469
|
-
_context3.next = 41;
|
|
470
|
-
return _this.fetchReconcile(JSON.stringify(currentState.content), 'fe-restore');
|
|
471
|
-
case 41:
|
|
472
|
-
(_this$analyticsHelper16 = _this.analyticsHelper) === null || _this$analyticsHelper16 === void 0 || _this$analyticsHelper16.sendActionEvent(_const.EVENT_ACTION.REINITIALISE_DOCUMENT, _const.EVENT_STATUS.SUCCESS, {
|
|
459
|
+
case 34:
|
|
460
|
+
(_this$analyticsHelper15 = _this.analyticsHelper) === null || _this$analyticsHelper15 === void 0 || _this$analyticsHelper15.sendActionEvent(_const.EVENT_ACTION.REINITIALISE_DOCUMENT, _const.EVENT_STATUS.SUCCESS, {
|
|
473
461
|
numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length,
|
|
474
462
|
hasTitle: !!(metadata !== null && metadata !== void 0 && metadata.title),
|
|
475
463
|
useReconcile: useReconcile,
|
|
@@ -477,19 +465,19 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
477
465
|
targetClientId: targetClientId,
|
|
478
466
|
triggeredByCatchup: !!targetClientId
|
|
479
467
|
});
|
|
480
|
-
_context3.next =
|
|
468
|
+
_context3.next = 42;
|
|
481
469
|
break;
|
|
482
|
-
case
|
|
483
|
-
_context3.prev =
|
|
470
|
+
case 37:
|
|
471
|
+
_context3.prev = 37;
|
|
484
472
|
_context3.t2 = _context3["catch"](10);
|
|
485
|
-
(_this$
|
|
473
|
+
(_this$analyticsHelper16 = _this.analyticsHelper) === null || _this$analyticsHelper16 === void 0 || _this$analyticsHelper16.sendActionEvent(_const.EVENT_ACTION.REINITIALISE_DOCUMENT, _const.EVENT_STATUS.FAILURE, {
|
|
486
474
|
numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length,
|
|
487
475
|
useReconcile: useReconcile,
|
|
488
476
|
clientId: _this.clientId,
|
|
489
477
|
targetClientId: targetClientId,
|
|
490
478
|
triggeredByCatchup: !!targetClientId
|
|
491
479
|
});
|
|
492
|
-
(_this$
|
|
480
|
+
(_this$analyticsHelper17 = _this.analyticsHelper) === null || _this$analyticsHelper17 === void 0 || _this$analyticsHelper17.sendErrorEvent(_context3.t2, "Error while reinitialising document. Use Reconcile: ".concat(useReconcile));
|
|
493
481
|
_this.onErrorHandled({
|
|
494
482
|
message: 'Caught error while trying to recover the document',
|
|
495
483
|
data: {
|
|
@@ -498,11 +486,11 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
498
486
|
code: _internalErrors.INTERNAL_ERROR_CODE.DOCUMENT_RESTORE_ERROR
|
|
499
487
|
}
|
|
500
488
|
});
|
|
501
|
-
case
|
|
489
|
+
case 42:
|
|
502
490
|
case "end":
|
|
503
491
|
return _context3.stop();
|
|
504
492
|
}
|
|
505
|
-
}, _callee3, null, [[10,
|
|
493
|
+
}, _callee3, null, [[10, 37], [13, 18], [22, 31]]);
|
|
506
494
|
}));
|
|
507
495
|
return function (_x4) {
|
|
508
496
|
return _ref7.apply(this, arguments);
|
|
@@ -510,7 +498,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
510
498
|
}());
|
|
511
499
|
(0, _defineProperty2.default)(this, "getFinalAcknowledgedState", /*#__PURE__*/function () {
|
|
512
500
|
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(reason) {
|
|
513
|
-
var _this$
|
|
501
|
+
var _this$analyticsHelper18, finalAcknowledgedState, currentState, reconcileResponse, measure, _this$analyticsHelper19, _this$analyticsHelper20, _measure2;
|
|
514
502
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
515
503
|
while (1) switch (_context4.prev = _context4.next) {
|
|
516
504
|
case 0:
|
|
@@ -545,7 +533,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
545
533
|
};
|
|
546
534
|
case 20:
|
|
547
535
|
measure = (0, _performance.stopMeasure)(_performance.MEASURE_NAME.PUBLISH_PAGE, _this.analyticsHelper);
|
|
548
|
-
(_this$
|
|
536
|
+
(_this$analyticsHelper18 = _this.analyticsHelper) === null || _this$analyticsHelper18 === void 0 || _this$analyticsHelper18.sendActionEvent(_const.EVENT_ACTION.PUBLISH_PAGE, _const.EVENT_STATUS.SUCCESS, {
|
|
549
537
|
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
550
538
|
});
|
|
551
539
|
_this.aggressiveCatchup = false;
|
|
@@ -555,10 +543,10 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
555
543
|
_context4.t1 = _context4["catch"](1);
|
|
556
544
|
_this.aggressiveCatchup = false;
|
|
557
545
|
_measure2 = (0, _performance.stopMeasure)(_performance.MEASURE_NAME.PUBLISH_PAGE, _this.analyticsHelper);
|
|
558
|
-
(_this$
|
|
546
|
+
(_this$analyticsHelper19 = _this.analyticsHelper) === null || _this$analyticsHelper19 === void 0 || _this$analyticsHelper19.sendActionEvent(_const.EVENT_ACTION.PUBLISH_PAGE, _const.EVENT_STATUS.FAILURE, {
|
|
559
547
|
latency: _measure2 === null || _measure2 === void 0 ? void 0 : _measure2.duration
|
|
560
548
|
});
|
|
561
|
-
(_this$
|
|
549
|
+
(_this$analyticsHelper20 = _this.analyticsHelper) === null || _this$analyticsHelper20 === void 0 || _this$analyticsHelper20.sendErrorEvent(_context4.t1, 'Error while returning ADF version of the final draft document');
|
|
562
550
|
throw _context4.t1;
|
|
563
551
|
case 33:
|
|
564
552
|
case "end":
|
|
@@ -593,7 +581,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
593
581
|
// ESS-5023: only emit error event if updated client version is still behind server version
|
|
594
582
|
// client version could become higher than server version due to user editing or plugin adding steps
|
|
595
583
|
if (updatedVersion < version) {
|
|
596
|
-
var _doc$content, _this$
|
|
584
|
+
var _doc$content, _this$analyticsHelper21;
|
|
597
585
|
var error = new _customErrors.UpdateDocumentError('Failed to update the document', {
|
|
598
586
|
newVersion: version,
|
|
599
587
|
editorVersion: updatedVersion,
|
|
@@ -602,7 +590,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
602
590
|
isDocContentValid: isDocContentValid,
|
|
603
591
|
caller: caller
|
|
604
592
|
});
|
|
605
|
-
(_this$
|
|
593
|
+
(_this$analyticsHelper21 = _this.analyticsHelper) === null || _this$analyticsHelper21 === void 0 || _this$analyticsHelper21.sendErrorEvent(error, 'Failed to update the document in document service');
|
|
606
594
|
if (_this.enableErrorOnFailedDocumentApply) {
|
|
607
595
|
_this.onErrorHandled({
|
|
608
596
|
message: 'The provider failed to apply changes to the editor',
|
|
@@ -619,8 +607,8 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
619
607
|
}
|
|
620
608
|
// Otherwise just fail silently for now
|
|
621
609
|
} else {
|
|
622
|
-
var _this$
|
|
623
|
-
(_this$
|
|
610
|
+
var _this$analyticsHelper22, _doc$content2;
|
|
611
|
+
(_this$analyticsHelper22 = _this.analyticsHelper) === null || _this$analyticsHelper22 === void 0 || _this$analyticsHelper22.sendActionEvent(_const.EVENT_ACTION.UPDATE_DOCUMENT, _const.EVENT_STATUS.SUCCESS, {
|
|
624
612
|
newVersion: version,
|
|
625
613
|
editorVersion: updatedVersion,
|
|
626
614
|
isDocTruthy: !!doc,
|
|
@@ -635,8 +623,8 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
635
623
|
try {
|
|
636
624
|
var _this$getState6;
|
|
637
625
|
if (!((_this$getState6 = _this.getState) !== null && _this$getState6 !== void 0 && _this$getState6.call(_this))) {
|
|
638
|
-
var _this$
|
|
639
|
-
(_this$
|
|
626
|
+
var _this$analyticsHelper23;
|
|
627
|
+
(_this$analyticsHelper23 = _this.analyticsHelper) === null || _this$analyticsHelper23 === void 0 || _this$analyticsHelper23.sendErrorEvent(new Error('Editor state is undefined'), 'validatePMJSONDocument called without state');
|
|
640
628
|
}
|
|
641
629
|
// Ignored via go/ees005
|
|
642
630
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -666,7 +654,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
666
654
|
*/
|
|
667
655
|
(0, _defineProperty2.default)(this, "commitUnconfirmedSteps", /*#__PURE__*/function () {
|
|
668
656
|
var _ref0 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(reason) {
|
|
669
|
-
var unconfirmedSteps, _this$getState7, _this$
|
|
657
|
+
var unconfirmedSteps, _this$getState7, _this$analyticsHelper25, count, unconfirmedTrs, lastTr, isLastTrConfirmed, _this$analyticsHelper24, nextUnconfirmedSteps, nextUnconfirmedTrs, _this$getUnconfirmedS, state, version, unconfirmedStepsInfoUGCRemoved, error, measure, _this$analyticsHelper26, _this$analyticsHelper27, _measure3;
|
|
670
658
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
671
659
|
while (1) switch (_context5.prev = _context5.next) {
|
|
672
660
|
case 0:
|
|
@@ -685,7 +673,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
685
673
|
lastTr = unconfirmedTrs === null || unconfirmedTrs === void 0 ? void 0 : unconfirmedTrs[unconfirmedTrs.length - 1];
|
|
686
674
|
isLastTrConfirmed = false;
|
|
687
675
|
if (!((_this$getState7 = _this.getState) !== null && _this$getState7 !== void 0 && _this$getState7.call(_this))) {
|
|
688
|
-
(_this$
|
|
676
|
+
(_this$analyticsHelper24 = _this.analyticsHelper) === null || _this$analyticsHelper24 === void 0 || _this$analyticsHelper24.sendErrorEvent(new Error('Editor state is undefined'), 'commitUnconfirmedSteps called without state');
|
|
689
677
|
}
|
|
690
678
|
case 9:
|
|
691
679
|
if (isLastTrConfirmed) {
|
|
@@ -735,7 +723,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
735
723
|
break;
|
|
736
724
|
case 22:
|
|
737
725
|
measure = (0, _performance.stopMeasure)(_performance.MEASURE_NAME.COMMIT_UNCONFIRMED_STEPS, _this.analyticsHelper);
|
|
738
|
-
(_this$
|
|
726
|
+
(_this$analyticsHelper25 = _this.analyticsHelper) === null || _this$analyticsHelper25 === void 0 || _this$analyticsHelper25.sendActionEvent(_const.EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, _const.EVENT_STATUS.SUCCESS, {
|
|
739
727
|
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
740
728
|
// upon success, emit the total number of unconfirmed steps we synced
|
|
741
729
|
numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length
|
|
@@ -747,11 +735,11 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
747
735
|
_context5.prev = 26;
|
|
748
736
|
_context5.t0 = _context5["catch"](1);
|
|
749
737
|
_measure3 = (0, _performance.stopMeasure)(_performance.MEASURE_NAME.COMMIT_UNCONFIRMED_STEPS, _this.analyticsHelper);
|
|
750
|
-
(_this$
|
|
738
|
+
(_this$analyticsHelper26 = _this.analyticsHelper) === null || _this$analyticsHelper26 === void 0 || _this$analyticsHelper26.sendActionEvent(_const.EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, _const.EVENT_STATUS.FAILURE, {
|
|
751
739
|
latency: _measure3 === null || _measure3 === void 0 ? void 0 : _measure3.duration,
|
|
752
740
|
numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length
|
|
753
741
|
});
|
|
754
|
-
(_this$
|
|
742
|
+
(_this$analyticsHelper27 = _this.analyticsHelper) === null || _this$analyticsHelper27 === void 0 || _this$analyticsHelper27.sendErrorEvent(_context5.t0, 'Error while committing unconfirmed steps');
|
|
755
743
|
throw _context5.t0;
|
|
756
744
|
case 32:
|
|
757
745
|
case "end":
|
|
@@ -764,17 +752,17 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
764
752
|
};
|
|
765
753
|
}());
|
|
766
754
|
(0, _defineProperty2.default)(this, "onStepRejectedError", function () {
|
|
767
|
-
var _this$
|
|
755
|
+
var _this$analyticsHelper28;
|
|
768
756
|
_this.stepRejectCounter++;
|
|
769
757
|
logger("Steps rejected (tries=".concat(_this.stepRejectCounter, ")"));
|
|
770
|
-
(_this$
|
|
758
|
+
(_this$analyticsHelper28 = _this.analyticsHelper) === null || _this$analyticsHelper28 === void 0 || _this$analyticsHelper28.sendActionEvent(_const.EVENT_ACTION.SEND_STEPS_RETRY, _const.EVENT_STATUS.INFO, {
|
|
771
759
|
count: _this.stepRejectCounter
|
|
772
760
|
});
|
|
773
761
|
var maxRetries = _this.aggressiveCatchup ? _provider.MAX_STEP_REJECTED_ERROR_AGGRESSIVE : _provider.MAX_STEP_REJECTED_ERROR;
|
|
774
762
|
if (_this.stepRejectCounter >= maxRetries) {
|
|
775
|
-
var _this$
|
|
763
|
+
var _this$analyticsHelper29;
|
|
776
764
|
logger("The steps were rejected too many times (tries=".concat(_this.stepRejectCounter, ", limit=").concat(_provider.MAX_STEP_REJECTED_ERROR, "). Trying to catch-up."));
|
|
777
|
-
(_this$
|
|
765
|
+
(_this$analyticsHelper29 = _this.analyticsHelper) === null || _this$analyticsHelper29 === void 0 || _this$analyticsHelper29.sendActionEvent(_const.EVENT_ACTION.CATCHUP_AFTER_MAX_SEND_STEPS_RETRY, _const.EVENT_STATUS.INFO);
|
|
778
766
|
_this.throttledCatchupv2(_const.CatchupEventReason.STEPS_REJECTED);
|
|
779
767
|
} else {
|
|
780
768
|
// If committing steps failed try again automatically in 1s
|
|
@@ -830,15 +818,15 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
830
818
|
value: function getVersionFromCollabState(state, resource) {
|
|
831
819
|
var collabState = (0, _prosemirrorCollab.getCollabState)(state);
|
|
832
820
|
if (!collabState) {
|
|
833
|
-
var _this$
|
|
834
|
-
(_this$
|
|
821
|
+
var _this$analyticsHelper30;
|
|
822
|
+
(_this$analyticsHelper30 = this.analyticsHelper) === null || _this$analyticsHelper30 === void 0 || _this$analyticsHelper30.sendErrorEvent(new Error('No collab state when calling ProseMirror function'), "".concat(resource, " called without collab state"));
|
|
835
823
|
return 0;
|
|
836
824
|
}
|
|
837
825
|
|
|
838
826
|
// This should not happen in usual, just add error event in case it happens
|
|
839
827
|
if (collabState.version === undefined) {
|
|
840
|
-
var _this$
|
|
841
|
-
(_this$
|
|
828
|
+
var _this$analyticsHelper31;
|
|
829
|
+
(_this$analyticsHelper31 = this.analyticsHelper) === null || _this$analyticsHelper31 === void 0 || _this$analyticsHelper31.sendErrorEvent(new Error('Collab state missing version info when calling ProseMirror function'), "".concat(resource, " called with collab state missing version info"));
|
|
842
830
|
return 0;
|
|
843
831
|
}
|
|
844
832
|
return collabState.version;
|
|
@@ -914,7 +902,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
914
902
|
logger("Processing data. Version \"".concat(version, "\"."));
|
|
915
903
|
if (steps !== null && steps !== void 0 && steps.length) {
|
|
916
904
|
try {
|
|
917
|
-
var _this$
|
|
905
|
+
var _this$analyticsHelper32;
|
|
918
906
|
var clientIds = steps.map(function (_ref1) {
|
|
919
907
|
var clientId = _ref1.clientId;
|
|
920
908
|
return clientId;
|
|
@@ -936,13 +924,13 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
936
924
|
return _this2.sendStepsFromCurrentState();
|
|
937
925
|
}, 100);
|
|
938
926
|
}
|
|
939
|
-
(_this$
|
|
927
|
+
(_this$analyticsHelper32 = this.analyticsHelper) === null || _this$analyticsHelper32 === void 0 || _this$analyticsHelper32.sendActionEvent(_const.EVENT_ACTION.PROCESS_STEPS, _const.EVENT_STATUS.SUCCESS);
|
|
940
928
|
} catch (error) {
|
|
941
|
-
var _this$
|
|
929
|
+
var _this$analyticsHelper33;
|
|
942
930
|
// ESS-6421: log if error processing steps when there are steps from the same userId but not the same clientId
|
|
943
931
|
var userIdMatch = this.isStepsFromNewClientIdForSameUserId(steps);
|
|
944
932
|
logger("Processing steps failed with error: ".concat(error, ". Triggering catch up call."));
|
|
945
|
-
(_this$
|
|
933
|
+
(_this$analyticsHelper33 = this.analyticsHelper) === null || _this$analyticsHelper33 === void 0 || _this$analyticsHelper33.sendErrorEvent(error, userIdMatch ? "Error while processing steps with new clientId" : "Error while processing steps");
|
|
946
934
|
this.throttledCatchupv2(_const.CatchupEventReason.PROCESS_STEPS);
|
|
947
935
|
}
|
|
948
936
|
}
|
|
@@ -994,8 +982,8 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
994
982
|
var _this$getState0;
|
|
995
983
|
var state = (_this$getState0 = this.getState) === null || _this$getState0 === void 0 ? void 0 : _this$getState0.call(this);
|
|
996
984
|
if (!state) {
|
|
997
|
-
var _this$
|
|
998
|
-
(_this$
|
|
985
|
+
var _this$analyticsHelper34;
|
|
986
|
+
(_this$analyticsHelper34 = this.analyticsHelper) === null || _this$analyticsHelper34 === void 0 || _this$analyticsHelper34.sendErrorEvent(new Error('Editor state is undefined'), 'sendStepsFromCurrentState called without state');
|
|
999
987
|
return;
|
|
1000
988
|
}
|
|
1001
989
|
this.send(null, null, state, sendAnalyticsEvent, reason);
|
|
@@ -1046,8 +1034,8 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
1046
1034
|
// to ensure that analytics events with the number of unconfirmed steps is only
|
|
1047
1035
|
// sent once on connection (as opposed to on every step)
|
|
1048
1036
|
if (sendAnalyticsEvent) {
|
|
1049
|
-
var _this$
|
|
1050
|
-
(_this$
|
|
1037
|
+
var _this$analyticsHelper35;
|
|
1038
|
+
(_this$analyticsHelper35 = this.analyticsHelper) === null || _this$analyticsHelper35 === void 0 || _this$analyticsHelper35.sendActionEvent(_const.EVENT_ACTION.HAS_UNCONFIRMED_STEPS, _const.EVENT_STATUS.INFO, {
|
|
1051
1039
|
numUnconfirmedSteps: (unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length) || 0
|
|
1052
1040
|
});
|
|
1053
1041
|
}
|
|
@@ -1056,12 +1044,12 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
1056
1044
|
}
|
|
1057
1045
|
var rebased = tr === null || tr === void 0 ? void 0 : tr.getMeta('rebasedData');
|
|
1058
1046
|
if (rebased) {
|
|
1059
|
-
var _this$
|
|
1047
|
+
var _this$analyticsHelper36;
|
|
1060
1048
|
var obfuscatedUnconfirmedSteps = this.obfuscateStepsAndState(rebased.unconfirmedSteps).obfuscatedSteps;
|
|
1061
1049
|
var obfuscatedRemoteSteps = this.obfuscateStepsAndState(rebased.remoteSteps);
|
|
1062
1050
|
var obfuscatedRebasedSteps = this.obfuscateStepsAndState(unconfirmedSteps).obfuscatedSteps;
|
|
1063
1051
|
// send analtyics on unconfirmed steps
|
|
1064
|
-
(_this$
|
|
1052
|
+
(_this$analyticsHelper36 = this.analyticsHelper) === null || _this$analyticsHelper36 === void 0 || _this$analyticsHelper36.sendActionEvent(_const.EVENT_ACTION.STEPS_REBASED, _const.EVENT_STATUS.INFO, {
|
|
1065
1053
|
obfuscatedUnconfirmedSteps: obfuscatedUnconfirmedSteps,
|
|
1066
1054
|
obfuscatedRemoteSteps: obfuscatedRemoteSteps,
|
|
1067
1055
|
obfuscatedRebasedSteps: obfuscatedRebasedSteps,
|
|
@@ -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 = "
|
|
8
|
+
var version = exports.version = "0.0.0-development";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|