@atlaskit/collab-provider 9.18.3 → 9.19.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 +12 -0
- package/dist/cjs/document/document-service.js +1 -1
- package/dist/cjs/errors/error-code-mapper.js +6 -0
- package/dist/cjs/errors/ncs-errors.js +5 -0
- package/dist/cjs/feature-flags/index.js +4 -4
- package/dist/cjs/provider/index.js +4 -4
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/document/document-service.js +1 -1
- package/dist/es2019/errors/error-code-mapper.js +6 -0
- package/dist/es2019/errors/ncs-errors.js +5 -0
- package/dist/es2019/feature-flags/index.js +4 -4
- package/dist/es2019/provider/index.js +4 -4
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/document/document-service.js +1 -1
- package/dist/esm/errors/error-code-mapper.js +6 -0
- package/dist/esm/errors/ncs-errors.js +5 -0
- package/dist/esm/feature-flags/index.js +4 -4
- package/dist/esm/provider/index.js +4 -4
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/errors/ncs-errors.d.ts +14 -2
- package/dist/types/feature-flags/types.d.ts +2 -2
- package/dist/types/types.d.ts +1 -0
- package/dist/types-ts4.5/errors/ncs-errors.d.ts +14 -2
- package/dist/types-ts4.5/feature-flags/types.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/collab-provider
|
|
2
2
|
|
|
3
|
+
## 9.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#58777](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58777) [`f28d4e12e540`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f28d4e12e540) - Added PROSEMIRROR_SCHEMA_VALIDATION_ERROR from NCS
|
|
8
|
+
|
|
9
|
+
## 9.18.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#58848](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58848) [`ec070585b78d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ec070585b78d) - fix the FF keys
|
|
14
|
+
|
|
3
15
|
## 9.18.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -50,7 +50,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
50
50
|
function DocumentService(participantsService, analyticsHelper, fetchCatchup, fetchReconcile, providerEmitCallback, broadcast, getUserId, onErrorHandled, metadataService) {
|
|
51
51
|
var _this = this;
|
|
52
52
|
var enableErrorOnFailedDocumentApply = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
53
|
-
var enableSendStepsQueue = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : (0, _featureFlags.getCollabProviderFeatureFlag)('
|
|
53
|
+
var enableSendStepsQueue = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : (0, _featureFlags.getCollabProviderFeatureFlag)('sendStepsQueue');
|
|
54
54
|
(0, _classCallCheck2.default)(this, DocumentService);
|
|
55
55
|
// Fires analytics to editor when collab editor cannot sync up
|
|
56
56
|
(0, _defineProperty2.default)(this, "stepRejectCounter", 0);
|
|
@@ -73,6 +73,12 @@ var errorCodeMapper = exports.errorCodeMapper = function errorCodeMapper(error)
|
|
|
73
73
|
recoverable: false,
|
|
74
74
|
status: 500
|
|
75
75
|
};
|
|
76
|
+
case _ncsErrors.NCS_ERROR_CODE.PROSEMIRROR_SCHEMA_VALIDATION_ERROR:
|
|
77
|
+
return {
|
|
78
|
+
code: _collab.PROVIDER_ERROR_CODE.INITIALISATION_ERROR,
|
|
79
|
+
message: "The initial document couldn't be loaded from the collab service due to a prosemirror schema validation error",
|
|
80
|
+
recoverable: false
|
|
81
|
+
};
|
|
76
82
|
case _internalErrors.INTERNAL_ERROR_CODE.DOCUMENT_UPDATE_ERROR:
|
|
77
83
|
return {
|
|
78
84
|
code: _collab.PROVIDER_ERROR_CODE.DOCUMENT_UPDATE_ERROR,
|
|
@@ -23,6 +23,7 @@ var NCS_ERROR_CODE = exports.NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_C
|
|
|
23
23
|
NCS_ERROR_CODE["INVALID_DOCUMENT_ARI"] = "INVALID_DOCUMENT_ARI";
|
|
24
24
|
NCS_ERROR_CODE["INVALID_CLOUD_ID"] = "INVALID_CLOUD_ID";
|
|
25
25
|
NCS_ERROR_CODE["RATE_LIMIT_ERROR"] = "RATE_LIMIT_ERROR";
|
|
26
|
+
NCS_ERROR_CODE["PROSEMIRROR_SCHEMA_VALIDATION_ERROR"] = "PROSEMIRROR_SCHEMA_VALIDATION_ERROR";
|
|
26
27
|
return NCS_ERROR_CODE;
|
|
27
28
|
}({}); // TODO: Import emitted error codes from NCS
|
|
28
29
|
// NCS Errors
|
|
@@ -30,6 +31,10 @@ var NCS_ERROR_CODE = exports.NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_C
|
|
|
30
31
|
// - Permission errors
|
|
31
32
|
// - Page missing / TTL errors
|
|
32
33
|
// - Server errors
|
|
34
|
+
/**
|
|
35
|
+
* The backend has retrieved the document successfully, as ADF, but failed to convert it to Prosemirror.
|
|
36
|
+
* This might be because invalid ADF has been written to a document, as it was not validated correctly.
|
|
37
|
+
*/
|
|
33
38
|
// - Less common back-end errors
|
|
34
39
|
/**
|
|
35
40
|
* The client is trying to send too many messages or messages that are too large. This not expected to be a standard
|
|
@@ -10,8 +10,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var defaultNCSFeatureFlags = {
|
|
11
11
|
testFF: false,
|
|
12
12
|
socketMessageMetricsFF: false,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
sendStepsQueue: false,
|
|
14
|
+
blockViewOnly: false
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -21,8 +21,8 @@ var productKeys = {
|
|
|
21
21
|
confluence: {
|
|
22
22
|
testFF: 'confluence.frontend.collab.provider.testFF',
|
|
23
23
|
socketMessageMetricsFF: 'confluence.frontend.collab.provider.socketMessageMetricsFF',
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
sendStepsQueue: 'confluence.frontend.ncs.send-steps-queue',
|
|
25
|
+
blockViewOnly: 'confluence.frontend.ncs.block-view-only'
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
var filterFeatureFlagNames = function filterFeatureFlagNames(flags) {
|
|
@@ -265,9 +265,9 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
265
265
|
_this.metadataService = new _metadataService.MetadataService(_this.emitCallback, _this.channel.sendMetadata);
|
|
266
266
|
_this.documentService = new _documentService.DocumentService(_this.participantsService, _this.analyticsHelper, _this.channel.fetchCatchup, _this.channel.fetchReconcile, _this.emitCallback, _this.channel.broadcast, function () {
|
|
267
267
|
return _this.userId;
|
|
268
|
-
}, _this.onErrorHandled, _this.metadataService, _this.config.enableErrorOnFailedDocumentApply, (0, _featureFlags.getCollabProviderFeatureFlag)('
|
|
268
|
+
}, _this.onErrorHandled, _this.metadataService, _this.config.enableErrorOnFailedDocumentApply, (0, _featureFlags.getCollabProviderFeatureFlag)('sendStepsQueue', _this.config.featureFlags));
|
|
269
269
|
_this.namespaceService = new _namespaceService.NamespaceService();
|
|
270
|
-
if ((0, _featureFlags.getCollabProviderFeatureFlag)('
|
|
270
|
+
if ((0, _featureFlags.getCollabProviderFeatureFlag)('sendStepsQueue', _this.config.featureFlags)) {
|
|
271
271
|
_this.sendStepsTimer = setInterval(function () {
|
|
272
272
|
logger('Intervally sendStepsFromCurrentState');
|
|
273
273
|
_this.documentService.sendStepsFromCurrentState(true);
|
|
@@ -384,7 +384,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
384
384
|
}, {
|
|
385
385
|
key: "isViewOnly",
|
|
386
386
|
value: function isViewOnly() {
|
|
387
|
-
return (0, _featureFlags.getCollabProviderFeatureFlag)('
|
|
387
|
+
return (0, _featureFlags.getCollabProviderFeatureFlag)('blockViewOnly', this.config.featureFlags) && this.permit &&
|
|
388
388
|
// isPermittedToEdit or isPermittedToView can be undefined, must use `===` here.
|
|
389
389
|
this.permit.isPermittedToEdit === false && this.permit.isPermittedToView === true;
|
|
390
390
|
}
|
|
@@ -452,7 +452,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
452
452
|
try {
|
|
453
453
|
(0, _get2.default)((0, _getPrototypeOf2.default)(Provider.prototype), "unsubscribeAll", this).call(this);
|
|
454
454
|
this.channel.disconnect();
|
|
455
|
-
if ((0, _featureFlags.getCollabProviderFeatureFlag)('
|
|
455
|
+
if ((0, _featureFlags.getCollabProviderFeatureFlag)('sendStepsQueue', this.config.featureFlags)) {
|
|
456
456
|
if (this.sendStepsTimer) {
|
|
457
457
|
clearInterval(this.sendStepsTimer);
|
|
458
458
|
this.sendStepsTimer = undefined;
|
|
@@ -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 = "9.
|
|
8
|
+
var version = exports.version = "9.19.0";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -34,7 +34,7 @@ export class DocumentService {
|
|
|
34
34
|
* @param enableErrorOnFailedDocumentApply - Enable failed document update exceptions.
|
|
35
35
|
* @param enableSendStepsQueue - Enable send steps queue.
|
|
36
36
|
*/
|
|
37
|
-
constructor(participantsService, analyticsHelper, fetchCatchup, fetchReconcile, providerEmitCallback, broadcast, getUserId, onErrorHandled, metadataService, enableErrorOnFailedDocumentApply = false, enableSendStepsQueue = getCollabProviderFeatureFlag('
|
|
37
|
+
constructor(participantsService, analyticsHelper, fetchCatchup, fetchReconcile, providerEmitCallback, broadcast, getUserId, onErrorHandled, metadataService, enableErrorOnFailedDocumentApply = false, enableSendStepsQueue = getCollabProviderFeatureFlag('sendStepsQueue')) {
|
|
38
38
|
// Fires analytics to editor when collab editor cannot sync up
|
|
39
39
|
_defineProperty(this, "stepRejectCounter", 0);
|
|
40
40
|
_defineProperty(this, "aggressiveCatchup", false);
|
|
@@ -68,6 +68,12 @@ export const errorCodeMapper = error => {
|
|
|
68
68
|
recoverable: false,
|
|
69
69
|
status: 500
|
|
70
70
|
};
|
|
71
|
+
case NCS_ERROR_CODE.PROSEMIRROR_SCHEMA_VALIDATION_ERROR:
|
|
72
|
+
return {
|
|
73
|
+
code: PROVIDER_ERROR_CODE.INITIALISATION_ERROR,
|
|
74
|
+
message: "The initial document couldn't be loaded from the collab service due to a prosemirror schema validation error",
|
|
75
|
+
recoverable: false
|
|
76
|
+
};
|
|
71
77
|
case INTERNAL_ERROR_CODE.DOCUMENT_UPDATE_ERROR:
|
|
72
78
|
return {
|
|
73
79
|
code: PROVIDER_ERROR_CODE.DOCUMENT_UPDATE_ERROR,
|
|
@@ -17,6 +17,7 @@ export let NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_CODE) {
|
|
|
17
17
|
NCS_ERROR_CODE["INVALID_DOCUMENT_ARI"] = "INVALID_DOCUMENT_ARI";
|
|
18
18
|
NCS_ERROR_CODE["INVALID_CLOUD_ID"] = "INVALID_CLOUD_ID";
|
|
19
19
|
NCS_ERROR_CODE["RATE_LIMIT_ERROR"] = "RATE_LIMIT_ERROR";
|
|
20
|
+
NCS_ERROR_CODE["PROSEMIRROR_SCHEMA_VALIDATION_ERROR"] = "PROSEMIRROR_SCHEMA_VALIDATION_ERROR";
|
|
20
21
|
return NCS_ERROR_CODE;
|
|
21
22
|
}({});
|
|
22
23
|
|
|
@@ -27,6 +28,10 @@ export let NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_CODE) {
|
|
|
27
28
|
// - Permission errors
|
|
28
29
|
// - Page missing / TTL errors
|
|
29
30
|
// - Server errors
|
|
31
|
+
/**
|
|
32
|
+
* The backend has retrieved the document successfully, as ADF, but failed to convert it to Prosemirror.
|
|
33
|
+
* This might be because invalid ADF has been written to a document, as it was not validated correctly.
|
|
34
|
+
*/
|
|
30
35
|
// - Less common back-end errors
|
|
31
36
|
/**
|
|
32
37
|
* The client is trying to send too many messages or messages that are too large. This not expected to be a standard
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const defaultNCSFeatureFlags = {
|
|
2
2
|
testFF: false,
|
|
3
3
|
socketMessageMetricsFF: false,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
sendStepsQueue: false,
|
|
5
|
+
blockViewOnly: false
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -12,8 +12,8 @@ const productKeys = {
|
|
|
12
12
|
confluence: {
|
|
13
13
|
testFF: 'confluence.frontend.collab.provider.testFF',
|
|
14
14
|
socketMessageMetricsFF: 'confluence.frontend.collab.provider.socketMessageMetricsFF',
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
sendStepsQueue: 'confluence.frontend.ncs.send-steps-queue',
|
|
16
|
+
blockViewOnly: 'confluence.frontend.ncs.block-view-only'
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
const filterFeatureFlagNames = flags => {
|
|
@@ -218,9 +218,9 @@ export class Provider extends Emitter {
|
|
|
218
218
|
this.isProviderInitialized = false;
|
|
219
219
|
this.participantsService = new ParticipantsService(this.analyticsHelper, undefined, this.emitCallback, this.config.getUser, this.channel.broadcast, this.channel.sendPresenceJoined, this.getPresenceData, this.setUserId);
|
|
220
220
|
this.metadataService = new MetadataService(this.emitCallback, this.channel.sendMetadata);
|
|
221
|
-
this.documentService = new DocumentService(this.participantsService, this.analyticsHelper, this.channel.fetchCatchup, this.channel.fetchReconcile, this.emitCallback, this.channel.broadcast, () => this.userId, this.onErrorHandled, this.metadataService, this.config.enableErrorOnFailedDocumentApply, getCollabProviderFeatureFlag('
|
|
221
|
+
this.documentService = new DocumentService(this.participantsService, this.analyticsHelper, this.channel.fetchCatchup, this.channel.fetchReconcile, this.emitCallback, this.channel.broadcast, () => this.userId, this.onErrorHandled, this.metadataService, this.config.enableErrorOnFailedDocumentApply, getCollabProviderFeatureFlag('sendStepsQueue', this.config.featureFlags));
|
|
222
222
|
this.namespaceService = new NamespaceService();
|
|
223
|
-
if (getCollabProviderFeatureFlag('
|
|
223
|
+
if (getCollabProviderFeatureFlag('sendStepsQueue', this.config.featureFlags)) {
|
|
224
224
|
this.sendStepsTimer = setInterval(() => {
|
|
225
225
|
logger('Intervally sendStepsFromCurrentState');
|
|
226
226
|
this.documentService.sendStepsFromCurrentState(true);
|
|
@@ -325,7 +325,7 @@ export class Provider extends Emitter {
|
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
isViewOnly() {
|
|
328
|
-
return getCollabProviderFeatureFlag('
|
|
328
|
+
return getCollabProviderFeatureFlag('blockViewOnly', this.config.featureFlags) && this.permit &&
|
|
329
329
|
// isPermittedToEdit or isPermittedToView can be undefined, must use `===` here.
|
|
330
330
|
this.permit.isPermittedToEdit === false && this.permit.isPermittedToView === true;
|
|
331
331
|
}
|
|
@@ -384,7 +384,7 @@ export class Provider extends Emitter {
|
|
|
384
384
|
try {
|
|
385
385
|
super.unsubscribeAll();
|
|
386
386
|
this.channel.disconnect();
|
|
387
|
-
if (getCollabProviderFeatureFlag('
|
|
387
|
+
if (getCollabProviderFeatureFlag('sendStepsQueue', this.config.featureFlags)) {
|
|
388
388
|
if (this.sendStepsTimer) {
|
|
389
389
|
clearInterval(this.sendStepsTimer);
|
|
390
390
|
this.sendStepsTimer = undefined;
|
|
@@ -43,7 +43,7 @@ export var DocumentService = /*#__PURE__*/function () {
|
|
|
43
43
|
function DocumentService(participantsService, analyticsHelper, fetchCatchup, fetchReconcile, providerEmitCallback, broadcast, getUserId, onErrorHandled, metadataService) {
|
|
44
44
|
var _this = this;
|
|
45
45
|
var enableErrorOnFailedDocumentApply = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
46
|
-
var enableSendStepsQueue = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : getCollabProviderFeatureFlag('
|
|
46
|
+
var enableSendStepsQueue = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : getCollabProviderFeatureFlag('sendStepsQueue');
|
|
47
47
|
_classCallCheck(this, DocumentService);
|
|
48
48
|
// Fires analytics to editor when collab editor cannot sync up
|
|
49
49
|
_defineProperty(this, "stepRejectCounter", 0);
|
|
@@ -68,6 +68,12 @@ export var errorCodeMapper = function errorCodeMapper(error) {
|
|
|
68
68
|
recoverable: false,
|
|
69
69
|
status: 500
|
|
70
70
|
};
|
|
71
|
+
case NCS_ERROR_CODE.PROSEMIRROR_SCHEMA_VALIDATION_ERROR:
|
|
72
|
+
return {
|
|
73
|
+
code: PROVIDER_ERROR_CODE.INITIALISATION_ERROR,
|
|
74
|
+
message: "The initial document couldn't be loaded from the collab service due to a prosemirror schema validation error",
|
|
75
|
+
recoverable: false
|
|
76
|
+
};
|
|
71
77
|
case INTERNAL_ERROR_CODE.DOCUMENT_UPDATE_ERROR:
|
|
72
78
|
return {
|
|
73
79
|
code: PROVIDER_ERROR_CODE.DOCUMENT_UPDATE_ERROR,
|
|
@@ -17,6 +17,7 @@ export var NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_CODE) {
|
|
|
17
17
|
NCS_ERROR_CODE["INVALID_DOCUMENT_ARI"] = "INVALID_DOCUMENT_ARI";
|
|
18
18
|
NCS_ERROR_CODE["INVALID_CLOUD_ID"] = "INVALID_CLOUD_ID";
|
|
19
19
|
NCS_ERROR_CODE["RATE_LIMIT_ERROR"] = "RATE_LIMIT_ERROR";
|
|
20
|
+
NCS_ERROR_CODE["PROSEMIRROR_SCHEMA_VALIDATION_ERROR"] = "PROSEMIRROR_SCHEMA_VALIDATION_ERROR";
|
|
20
21
|
return NCS_ERROR_CODE;
|
|
21
22
|
}({});
|
|
22
23
|
|
|
@@ -27,6 +28,10 @@ export var NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_CODE) {
|
|
|
27
28
|
// - Permission errors
|
|
28
29
|
// - Page missing / TTL errors
|
|
29
30
|
// - Server errors
|
|
31
|
+
/**
|
|
32
|
+
* The backend has retrieved the document successfully, as ADF, but failed to convert it to Prosemirror.
|
|
33
|
+
* This might be because invalid ADF has been written to a document, as it was not validated correctly.
|
|
34
|
+
*/
|
|
30
35
|
// - Less common back-end errors
|
|
31
36
|
/**
|
|
32
37
|
* The client is trying to send too many messages or messages that are too large. This not expected to be a standard
|
|
@@ -2,8 +2,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
var defaultNCSFeatureFlags = {
|
|
3
3
|
testFF: false,
|
|
4
4
|
socketMessageMetricsFF: false,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
sendStepsQueue: false,
|
|
6
|
+
blockViewOnly: false
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -13,8 +13,8 @@ var productKeys = {
|
|
|
13
13
|
confluence: {
|
|
14
14
|
testFF: 'confluence.frontend.collab.provider.testFF',
|
|
15
15
|
socketMessageMetricsFF: 'confluence.frontend.collab.provider.socketMessageMetricsFF',
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
sendStepsQueue: 'confluence.frontend.ncs.send-steps-queue',
|
|
17
|
+
blockViewOnly: 'confluence.frontend.ncs.block-view-only'
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
var filterFeatureFlagNames = function filterFeatureFlagNames(flags) {
|
|
@@ -258,9 +258,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
258
258
|
_this.metadataService = new MetadataService(_this.emitCallback, _this.channel.sendMetadata);
|
|
259
259
|
_this.documentService = new DocumentService(_this.participantsService, _this.analyticsHelper, _this.channel.fetchCatchup, _this.channel.fetchReconcile, _this.emitCallback, _this.channel.broadcast, function () {
|
|
260
260
|
return _this.userId;
|
|
261
|
-
}, _this.onErrorHandled, _this.metadataService, _this.config.enableErrorOnFailedDocumentApply, getCollabProviderFeatureFlag('
|
|
261
|
+
}, _this.onErrorHandled, _this.metadataService, _this.config.enableErrorOnFailedDocumentApply, getCollabProviderFeatureFlag('sendStepsQueue', _this.config.featureFlags));
|
|
262
262
|
_this.namespaceService = new NamespaceService();
|
|
263
|
-
if (getCollabProviderFeatureFlag('
|
|
263
|
+
if (getCollabProviderFeatureFlag('sendStepsQueue', _this.config.featureFlags)) {
|
|
264
264
|
_this.sendStepsTimer = setInterval(function () {
|
|
265
265
|
logger('Intervally sendStepsFromCurrentState');
|
|
266
266
|
_this.documentService.sendStepsFromCurrentState(true);
|
|
@@ -377,7 +377,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
377
377
|
}, {
|
|
378
378
|
key: "isViewOnly",
|
|
379
379
|
value: function isViewOnly() {
|
|
380
|
-
return getCollabProviderFeatureFlag('
|
|
380
|
+
return getCollabProviderFeatureFlag('blockViewOnly', this.config.featureFlags) && this.permit &&
|
|
381
381
|
// isPermittedToEdit or isPermittedToView can be undefined, must use `===` here.
|
|
382
382
|
this.permit.isPermittedToEdit === false && this.permit.isPermittedToView === true;
|
|
383
383
|
}
|
|
@@ -445,7 +445,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
445
445
|
try {
|
|
446
446
|
_get(_getPrototypeOf(Provider.prototype), "unsubscribeAll", this).call(this);
|
|
447
447
|
this.channel.disconnect();
|
|
448
|
-
if (getCollabProviderFeatureFlag('
|
|
448
|
+
if (getCollabProviderFeatureFlag('sendStepsQueue', this.config.featureFlags)) {
|
|
449
449
|
if (this.sendStepsTimer) {
|
|
450
450
|
clearInterval(this.sendStepsTimer);
|
|
451
451
|
this.sendStepsTimer = undefined;
|
|
@@ -15,7 +15,8 @@ export declare enum NCS_ERROR_CODE {
|
|
|
15
15
|
INVALID_ACTIVATION_ID = "INVALID_ACTIVATION_ID",
|
|
16
16
|
INVALID_DOCUMENT_ARI = "INVALID_DOCUMENT_ARI",
|
|
17
17
|
INVALID_CLOUD_ID = "INVALID_CLOUD_ID",
|
|
18
|
-
RATE_LIMIT_ERROR = "RATE_LIMIT_ERROR"
|
|
18
|
+
RATE_LIMIT_ERROR = "RATE_LIMIT_ERROR",
|
|
19
|
+
PROSEMIRROR_SCHEMA_VALIDATION_ERROR = "PROSEMIRROR_SCHEMA_VALIDATION_ERROR"
|
|
19
20
|
}
|
|
20
21
|
type HeadVersionUpdateFailedError = {
|
|
21
22
|
message: string;
|
|
@@ -69,6 +70,17 @@ type FailedToLoadInitDataError = {
|
|
|
69
70
|
status: number;
|
|
70
71
|
};
|
|
71
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* The backend has retrieved the document successfully, as ADF, but failed to convert it to Prosemirror.
|
|
75
|
+
* This might be because invalid ADF has been written to a document, as it was not validated correctly.
|
|
76
|
+
*/
|
|
77
|
+
type ProsemirrorSchemaValidationError = {
|
|
78
|
+
message: string;
|
|
79
|
+
data: {
|
|
80
|
+
code: NCS_ERROR_CODE.PROSEMIRROR_SCHEMA_VALIDATION_ERROR;
|
|
81
|
+
status: number;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
72
84
|
type ErrorMappingError = {
|
|
73
85
|
message: string;
|
|
74
86
|
data: {
|
|
@@ -168,5 +180,5 @@ export type RateLimitError = {
|
|
|
168
180
|
status: 500;
|
|
169
181
|
};
|
|
170
182
|
};
|
|
171
|
-
export type NCSErrors = HeadVersionUpdateFailedError | VersionAlreadyPresentInDynamoError | InsufficientEditingPermissionError | ForbiddenUserTokenError | NCSDocumentNotFoundError | FailedToLoadInitDataError | ErrorMappingError | InvalidNamespaceDefinedError | SocketNamespaceNotFoundError | TenantInstanceMaintenanceError | NamespaceLockedError | EmptyBroadcastError | DynamoError | InvalidActivationIdError | InvalidDocumentAriError | InvalidCloudIdError | RateLimitError;
|
|
183
|
+
export type NCSErrors = HeadVersionUpdateFailedError | VersionAlreadyPresentInDynamoError | InsufficientEditingPermissionError | ForbiddenUserTokenError | NCSDocumentNotFoundError | FailedToLoadInitDataError | ErrorMappingError | InvalidNamespaceDefinedError | SocketNamespaceNotFoundError | TenantInstanceMaintenanceError | NamespaceLockedError | EmptyBroadcastError | DynamoError | InvalidActivationIdError | InvalidDocumentAriError | InvalidCloudIdError | RateLimitError | ProsemirrorSchemaValidationError;
|
|
172
184
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface NCSFeatureFlags {
|
|
2
2
|
testFF?: boolean;
|
|
3
3
|
socketMessageMetricsFF?: boolean;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
sendStepsQueue?: boolean;
|
|
5
|
+
blockViewOnly?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export interface WithNCSFeatureFlags {
|
|
8
8
|
featureFlags?: NCSFeatureFlags;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -15,7 +15,8 @@ export declare enum NCS_ERROR_CODE {
|
|
|
15
15
|
INVALID_ACTIVATION_ID = "INVALID_ACTIVATION_ID",
|
|
16
16
|
INVALID_DOCUMENT_ARI = "INVALID_DOCUMENT_ARI",
|
|
17
17
|
INVALID_CLOUD_ID = "INVALID_CLOUD_ID",
|
|
18
|
-
RATE_LIMIT_ERROR = "RATE_LIMIT_ERROR"
|
|
18
|
+
RATE_LIMIT_ERROR = "RATE_LIMIT_ERROR",
|
|
19
|
+
PROSEMIRROR_SCHEMA_VALIDATION_ERROR = "PROSEMIRROR_SCHEMA_VALIDATION_ERROR"
|
|
19
20
|
}
|
|
20
21
|
type HeadVersionUpdateFailedError = {
|
|
21
22
|
message: string;
|
|
@@ -69,6 +70,17 @@ type FailedToLoadInitDataError = {
|
|
|
69
70
|
status: number;
|
|
70
71
|
};
|
|
71
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* The backend has retrieved the document successfully, as ADF, but failed to convert it to Prosemirror.
|
|
75
|
+
* This might be because invalid ADF has been written to a document, as it was not validated correctly.
|
|
76
|
+
*/
|
|
77
|
+
type ProsemirrorSchemaValidationError = {
|
|
78
|
+
message: string;
|
|
79
|
+
data: {
|
|
80
|
+
code: NCS_ERROR_CODE.PROSEMIRROR_SCHEMA_VALIDATION_ERROR;
|
|
81
|
+
status: number;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
72
84
|
type ErrorMappingError = {
|
|
73
85
|
message: string;
|
|
74
86
|
data: {
|
|
@@ -168,5 +180,5 @@ export type RateLimitError = {
|
|
|
168
180
|
status: 500;
|
|
169
181
|
};
|
|
170
182
|
};
|
|
171
|
-
export type NCSErrors = HeadVersionUpdateFailedError | VersionAlreadyPresentInDynamoError | InsufficientEditingPermissionError | ForbiddenUserTokenError | NCSDocumentNotFoundError | FailedToLoadInitDataError | ErrorMappingError | InvalidNamespaceDefinedError | SocketNamespaceNotFoundError | TenantInstanceMaintenanceError | NamespaceLockedError | EmptyBroadcastError | DynamoError | InvalidActivationIdError | InvalidDocumentAriError | InvalidCloudIdError | RateLimitError;
|
|
183
|
+
export type NCSErrors = HeadVersionUpdateFailedError | VersionAlreadyPresentInDynamoError | InsufficientEditingPermissionError | ForbiddenUserTokenError | NCSDocumentNotFoundError | FailedToLoadInitDataError | ErrorMappingError | InvalidNamespaceDefinedError | SocketNamespaceNotFoundError | TenantInstanceMaintenanceError | NamespaceLockedError | EmptyBroadcastError | DynamoError | InvalidActivationIdError | InvalidDocumentAriError | InvalidCloudIdError | RateLimitError | ProsemirrorSchemaValidationError;
|
|
172
184
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface NCSFeatureFlags {
|
|
2
2
|
testFF?: boolean;
|
|
3
3
|
socketMessageMetricsFF?: boolean;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
sendStepsQueue?: boolean;
|
|
5
|
+
blockViewOnly?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export interface WithNCSFeatureFlags {
|
|
8
8
|
featureFlags?: NCSFeatureFlags;
|