@atlaskit/collab-provider 7.6.2 → 7.7.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 +22 -0
- package/dist/cjs/analytics/index.js +4 -1
- package/dist/cjs/analytics/performance.js +2 -0
- package/dist/cjs/channel.js +17 -0
- package/dist/cjs/config.js +2 -2
- package/dist/cjs/helpers/const.js +4 -4
- package/dist/cjs/provider/index.js +188 -67
- package/dist/cjs/socket-io-provider.js +1 -0
- package/dist/cjs/version-wrapper.js +16 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/index.js +4 -2
- package/dist/es2019/analytics/performance.js +2 -0
- package/dist/es2019/channel.js +18 -0
- package/dist/es2019/config.js +2 -2
- package/dist/es2019/helpers/const.js +3 -2
- package/dist/es2019/provider/index.js +117 -13
- package/dist/es2019/socket-io-provider.js +1 -0
- package/dist/es2019/version-wrapper.js +5 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/index.js +4 -2
- package/dist/esm/analytics/performance.js +2 -0
- package/dist/esm/channel.js +17 -0
- package/dist/esm/config.js +2 -2
- package/dist/esm/helpers/const.js +3 -2
- package/dist/esm/provider/index.js +191 -67
- package/dist/esm/socket-io-provider.js +1 -0
- package/dist/esm/version-wrapper.js +5 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/performance.d.ts +3 -1
- package/dist/types/helpers/const.d.ts +5 -3
- package/dist/types/provider/index.d.ts +6 -0
- package/dist/types/types.d.ts +7 -0
- package/dist/types/version-wrapper.d.ts +3 -0
- package/package.json +7 -11
- package/report.api.md +154 -177
- package/version-wrapper/package.json +15 -0
- package/dist/types-ts4.0/analytics/index.d.ts +0 -5
- package/dist/types-ts4.0/analytics/performance.d.ts +0 -12
- package/dist/types-ts4.0/channel.d.ts +0 -27
- package/dist/types-ts4.0/config.d.ts +0 -5
- package/dist/types-ts4.0/disconnected-reason-mapper.d.ts +0 -15
- package/dist/types-ts4.0/emitter.d.ts +0 -19
- package/dist/types-ts4.0/error-code-mapper.d.ts +0 -32
- package/dist/types-ts4.0/helpers/const.d.ts +0 -31
- package/dist/types-ts4.0/helpers/utils.d.ts +0 -11
- package/dist/types-ts4.0/index.d.ts +0 -2
- package/dist/types-ts4.0/provider/catchup.d.ts +0 -9
- package/dist/types-ts4.0/provider/index.d.ts +0 -124
- package/dist/types-ts4.0/socket-io-provider.d.ts +0 -4
- package/dist/types-ts4.0/types.d.ts +0 -170
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EVENT_SUBJECT, COLLAB_SERVICE } from '../helpers/const';
|
|
2
|
+
import { name as packageName, version as packageVersion } from '../version-wrapper';
|
|
2
3
|
export const fireAnalyticsEvent = (analyticsClient, payload) => {
|
|
3
4
|
if (!analyticsClient || !payload) {
|
|
4
5
|
return;
|
|
@@ -24,7 +25,8 @@ export const triggerCollabAnalyticsEvent = (analyticsEvent, analyticsClient) =>
|
|
|
24
25
|
actionSubject: EVENT_SUBJECT,
|
|
25
26
|
source: 'unknown',
|
|
26
27
|
attributes: {
|
|
27
|
-
packageName
|
|
28
|
+
packageName,
|
|
29
|
+
packageVersion,
|
|
28
30
|
collabService: COLLAB_SERVICE.NCS,
|
|
29
31
|
...analyticsEvent.attributes
|
|
30
32
|
}
|
|
@@ -5,6 +5,8 @@ export let MEASURE_NAME;
|
|
|
5
5
|
MEASURE_NAME["SOCKET_CONNECT"] = "socketConnect";
|
|
6
6
|
MEASURE_NAME["DOCUMENT_INIT"] = "documentInit";
|
|
7
7
|
MEASURE_NAME["CONVERT_PM_TO_ADF"] = "convertPMToADF";
|
|
8
|
+
MEASURE_NAME["ADD_STEPS"] = "addSteps";
|
|
9
|
+
MEASURE_NAME["COMMIT_UNCONFIRMED_STEPS"] = "commitUnconfirmedSteps";
|
|
8
10
|
})(MEASURE_NAME || (MEASURE_NAME = {}));
|
|
9
11
|
|
|
10
12
|
const isPerformanceAPIAvailable = () => {
|
package/dist/es2019/channel.js
CHANGED
|
@@ -71,6 +71,20 @@ export class Channel extends Emitter {
|
|
|
71
71
|
userId,
|
|
72
72
|
metadata
|
|
73
73
|
});
|
|
74
|
+
} else {
|
|
75
|
+
// Page is been just restored, need to fix all the participants as well.
|
|
76
|
+
const {
|
|
77
|
+
doc,
|
|
78
|
+
version,
|
|
79
|
+
userId,
|
|
80
|
+
metadata
|
|
81
|
+
} = data;
|
|
82
|
+
this.emit('restore', {
|
|
83
|
+
doc,
|
|
84
|
+
version,
|
|
85
|
+
userId,
|
|
86
|
+
metadata
|
|
87
|
+
});
|
|
74
88
|
}
|
|
75
89
|
} else {
|
|
76
90
|
this.emit('steps:added', data);
|
|
@@ -169,6 +183,10 @@ export class Channel extends Emitter {
|
|
|
169
183
|
});
|
|
170
184
|
this.socket.on('metadata:changed', payload => {
|
|
171
185
|
this.emit('metadata:changed', payload);
|
|
186
|
+
}); // ESS-2916 namespace status event - lock/unlock
|
|
187
|
+
|
|
188
|
+
this.socket.on('status', data => {
|
|
189
|
+
this.emit('status', data);
|
|
172
190
|
});
|
|
173
191
|
this.socket.on('disconnect', async reason => {
|
|
174
192
|
this.connected = false;
|
package/dist/es2019/config.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export const ATTRIBUTES_PACKAGE = 'collabProvider';
|
|
2
1
|
export const EVENT_SUBJECT = 'collab';
|
|
3
2
|
export let COLLAB_SERVICE;
|
|
4
3
|
|
|
@@ -16,6 +15,8 @@ export let EVENT_ACTION;
|
|
|
16
15
|
EVENT_ACTION["ADD_STEPS"] = "addSteps";
|
|
17
16
|
EVENT_ACTION["CONVERT_PM_TO_ADF"] = "convertPMToADF";
|
|
18
17
|
EVENT_ACTION["UPDATE_PARTICIPANTS"] = "updateParticipants";
|
|
18
|
+
EVENT_ACTION["COMMIT_UNCONFIRMED_STEPS"] = "commitUnconfirmedSteps";
|
|
19
|
+
EVENT_ACTION["REINITIALISE_DOCUMENT"] = "reinitialiseDocument";
|
|
19
20
|
})(EVENT_ACTION || (EVENT_ACTION = {}));
|
|
20
21
|
|
|
21
22
|
export let EVENT_STATUS;
|
|
@@ -25,4 +26,4 @@ export let EVENT_STATUS;
|
|
|
25
26
|
EVENT_STATUS["FAILURE"] = "FAILURE";
|
|
26
27
|
})(EVENT_STATUS || (EVENT_STATUS = {}));
|
|
27
28
|
|
|
28
|
-
export const ACK_MAX_TRY =
|
|
29
|
+
export const ACK_MAX_TRY = 30;
|
|
@@ -50,6 +50,7 @@ const throttledCommitStep = throttle(commitStep, SEND_STEPS_THROTTLE, {
|
|
|
50
50
|
trailing: true
|
|
51
51
|
});
|
|
52
52
|
export class Provider extends Emitter {
|
|
53
|
+
// To keep track of the namespace event changes from the server.
|
|
53
54
|
constructor(config) {
|
|
54
55
|
super();
|
|
55
56
|
|
|
@@ -61,6 +62,8 @@ export class Provider extends Emitter {
|
|
|
61
62
|
|
|
62
63
|
_defineProperty(this, "isChannelInitialized", false);
|
|
63
64
|
|
|
65
|
+
_defineProperty(this, "isNamespaceLocked", false);
|
|
66
|
+
|
|
64
67
|
_defineProperty(this, "initializeChannel", () => {
|
|
65
68
|
this.channel.on('connected', ({
|
|
66
69
|
sid,
|
|
@@ -88,7 +91,42 @@ export class Provider extends Emitter {
|
|
|
88
91
|
version,
|
|
89
92
|
metadata
|
|
90
93
|
});
|
|
91
|
-
}).on('steps:added', this.onStepsAdded.bind(this)).on('participant:telepointer', this.onParticipantTelepointer.bind(this)).on('presence:joined', this.onPresenceJoined.bind(this)).on('presence', this.onPresence.bind(this)).on('participant:left', this.onParticipantLeft.bind(this)).on('participant:updated', this.onParticipantUpdated.bind(this)).on('metadata:changed', this.onMetadataChanged.bind(this)).on('disconnect', this.onDisconnected.bind(this)).on('error', this.onErrorHandled.bind(this)).connect();
|
|
94
|
+
}).on('restore', this.onRestore.bind(this)).on('steps:added', this.onStepsAdded.bind(this)).on('participant:telepointer', this.onParticipantTelepointer.bind(this)).on('presence:joined', this.onPresenceJoined.bind(this)).on('presence', this.onPresence.bind(this)).on('participant:left', this.onParticipantLeft.bind(this)).on('participant:updated', this.onParticipantUpdated.bind(this)).on('metadata:changed', this.onMetadataChanged.bind(this)).on('disconnect', this.onDisconnected.bind(this)).on('error', this.onErrorHandled.bind(this)).on('status', this.onNamespaceStatusChanged.bind(this)).connect();
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
_defineProperty(this, "onRestore", ({
|
|
98
|
+
doc,
|
|
99
|
+
version,
|
|
100
|
+
metadata
|
|
101
|
+
}) => {
|
|
102
|
+
// Preseve the unconfirmed steps to prevent data loss.
|
|
103
|
+
const {
|
|
104
|
+
steps: unconfirmedSteps
|
|
105
|
+
} = this.getUnconfirmedSteps() || {
|
|
106
|
+
steps: []
|
|
107
|
+
}; // Reset the editor,
|
|
108
|
+
// - Repalce the document, keep in sync with the server
|
|
109
|
+
// - Repalce the version number, so editor is in sync with NCS server and can commit new changes.
|
|
110
|
+
// - Repalce the metadata
|
|
111
|
+
// - Reserve the cursore position, in case a cursor jump.
|
|
112
|
+
|
|
113
|
+
this.updateDocumentWithMetadata({
|
|
114
|
+
doc,
|
|
115
|
+
version,
|
|
116
|
+
metadata,
|
|
117
|
+
reserveCursor: true
|
|
118
|
+
});
|
|
119
|
+
triggerCollabAnalyticsEvent({
|
|
120
|
+
eventAction: EVENT_ACTION.REINITIALISE_DOCUMENT,
|
|
121
|
+
attributes: {
|
|
122
|
+
numUnconfirmedSteps: unconfirmedSteps.length,
|
|
123
|
+
documentAri: this.config.documentAri
|
|
124
|
+
}
|
|
125
|
+
}, this.analyticsClient); // Re-apply the unconfirmed steps, not 100% of them can be applied, if document is changed significantly.
|
|
126
|
+
|
|
127
|
+
if (unconfirmedSteps.length > 0) {
|
|
128
|
+
this.applyLocalsteps(unconfirmedSteps);
|
|
129
|
+
}
|
|
92
130
|
});
|
|
93
131
|
|
|
94
132
|
_defineProperty(this, "onStepsAdded", data => {
|
|
@@ -216,12 +254,14 @@ export class Provider extends Emitter {
|
|
|
216
254
|
_defineProperty(this, "onErrorHandled", error => {
|
|
217
255
|
if (error && error.data) {
|
|
218
256
|
if (error.data.code === 'HEAD_VERSION_UPDATE_FAILED' || error.data.code === 'VERSION_NUMBER_ALREADY_EXISTS') {
|
|
257
|
+
const measure = stopMeasure(MEASURE_NAME.ADD_STEPS);
|
|
219
258
|
triggerCollabAnalyticsEvent({
|
|
220
259
|
eventAction: EVENT_ACTION.ADD_STEPS,
|
|
221
260
|
attributes: {
|
|
222
261
|
eventStatus: EVENT_STATUS.FAILURE,
|
|
223
262
|
error,
|
|
224
|
-
documentAri: this.config.documentAri
|
|
263
|
+
documentAri: this.config.documentAri,
|
|
264
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
225
265
|
}
|
|
226
266
|
}, this.analyticsClient);
|
|
227
267
|
this.stepRejectCounter++;
|
|
@@ -468,17 +508,18 @@ export class Provider extends Emitter {
|
|
|
468
508
|
let unconfirmedState = this.getUnconfirmedSteps();
|
|
469
509
|
|
|
470
510
|
if (unconfirmedState && unconfirmedState.steps.length) {
|
|
471
|
-
// We use origins here as steps can be rebased. When steps are rebased a new step is created.
|
|
511
|
+
startMeasure(MEASURE_NAME.COMMIT_UNCONFIRMED_STEPS); // We use origins here as steps can be rebased. When steps are rebased a new step is created.
|
|
472
512
|
// This means that we can not track if it has been removed from the unconfirmed array or not.
|
|
473
513
|
// Origins points to the original transaction that the step was created in. This is never changed
|
|
474
514
|
// and gets passed down when a step is rebased.
|
|
515
|
+
|
|
475
516
|
const unconfirmedTrs = unconfirmedState.origins;
|
|
476
517
|
const lastTr = unconfirmedTrs[unconfirmedTrs.length - 1];
|
|
477
518
|
let isLastTrConfirmed = false;
|
|
478
519
|
|
|
479
520
|
while (!isLastTrConfirmed) {
|
|
480
521
|
this.sendStepsFromCurrentState();
|
|
481
|
-
await sleep(
|
|
522
|
+
await sleep(1000);
|
|
482
523
|
const nextUnconfirmedState = this.getUnconfirmedSteps();
|
|
483
524
|
|
|
484
525
|
if (nextUnconfirmedState && nextUnconfirmedState.steps.length) {
|
|
@@ -500,9 +541,32 @@ export class Provider extends Emitter {
|
|
|
500
541
|
});
|
|
501
542
|
}
|
|
502
543
|
|
|
503
|
-
|
|
544
|
+
const measure = stopMeasure(MEASURE_NAME.COMMIT_UNCONFIRMED_STEPS);
|
|
545
|
+
triggerCollabAnalyticsEvent({
|
|
546
|
+
eventAction: EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS,
|
|
547
|
+
attributes: {
|
|
548
|
+
eventStatus: EVENT_STATUS.FAILURE,
|
|
549
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
550
|
+
documentAri: this.config.documentAri,
|
|
551
|
+
// upon failure, emit the number of unconfirmed steps we attempted to sync
|
|
552
|
+
numUnconfirmedSteps: nextUnconfirmedState === null || nextUnconfirmedState === void 0 ? void 0 : nextUnconfirmedState.steps.length
|
|
553
|
+
}
|
|
554
|
+
}, this.analyticsClient);
|
|
555
|
+
throw new Error("Can't sync up with Collab Service");
|
|
504
556
|
}
|
|
505
557
|
}
|
|
558
|
+
|
|
559
|
+
const measure = stopMeasure(MEASURE_NAME.COMMIT_UNCONFIRMED_STEPS);
|
|
560
|
+
triggerCollabAnalyticsEvent({
|
|
561
|
+
eventAction: EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS,
|
|
562
|
+
attributes: {
|
|
563
|
+
eventStatus: EVENT_STATUS.SUCCESS,
|
|
564
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
565
|
+
documentAri: this.config.documentAri,
|
|
566
|
+
// upon success, emit the total number of unconfirmed steps we synced
|
|
567
|
+
numUnconfirmedSteps: unconfirmedState.steps.length
|
|
568
|
+
}
|
|
569
|
+
}, this.analyticsClient);
|
|
506
570
|
}
|
|
507
571
|
|
|
508
572
|
const state = this.getState(); // Convert ProseMirror document in Editor state to ADF document
|
|
@@ -542,6 +606,37 @@ export class Provider extends Emitter {
|
|
|
542
606
|
};
|
|
543
607
|
});
|
|
544
608
|
|
|
609
|
+
_defineProperty(this, "onNamespaceStatusChanged", async data => {
|
|
610
|
+
const {
|
|
611
|
+
isLocked,
|
|
612
|
+
waitTimeInMs,
|
|
613
|
+
timestamp
|
|
614
|
+
} = data;
|
|
615
|
+
const start = Date.now();
|
|
616
|
+
logger(`Received a namespace status changed event `, {
|
|
617
|
+
data
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
if (isLocked && waitTimeInMs) {
|
|
621
|
+
this.isNamespaceLocked = true;
|
|
622
|
+
logger(`Received a namespace status change event `, {
|
|
623
|
+
isLocked
|
|
624
|
+
}); // To protect the collab editing process from locked out due to BE
|
|
625
|
+
|
|
626
|
+
setTimeout(() => {
|
|
627
|
+
logger(`The namespace lock has expired`, {
|
|
628
|
+
waitTime: Date.now() - start,
|
|
629
|
+
timestamp
|
|
630
|
+
});
|
|
631
|
+
this.isNamespaceLocked = false;
|
|
632
|
+
}, waitTimeInMs);
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
this.isNamespaceLocked = false;
|
|
637
|
+
logger(`The page lock has expired`);
|
|
638
|
+
});
|
|
639
|
+
|
|
545
640
|
this.config = config;
|
|
546
641
|
this.channel = new Channel(config);
|
|
547
642
|
this.isChannelInitialized = false;
|
|
@@ -607,17 +702,23 @@ export class Provider extends Emitter {
|
|
|
607
702
|
return;
|
|
608
703
|
}
|
|
609
704
|
|
|
705
|
+
if (this.isNamespaceLocked) {
|
|
706
|
+
logger('The document is temporary locked');
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
|
|
610
710
|
const {
|
|
611
711
|
steps
|
|
612
712
|
} = sendable;
|
|
613
713
|
|
|
614
714
|
if (!steps || !steps.length) {
|
|
615
715
|
return;
|
|
616
|
-
}
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
startMeasure(MEASURE_NAME.ADD_STEPS); // Avoid reference issues using a
|
|
617
719
|
// method outside of the provider
|
|
618
720
|
// scope
|
|
619
721
|
|
|
620
|
-
|
|
621
722
|
throttledCommitStep({
|
|
622
723
|
channel: this.channel,
|
|
623
724
|
userId: this.userId,
|
|
@@ -625,10 +726,7 @@ export class Provider extends Emitter {
|
|
|
625
726
|
steps,
|
|
626
727
|
version
|
|
627
728
|
});
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* Called when we receive steps from the service
|
|
631
|
-
*/
|
|
729
|
+
} // Triggered when page recovery has emitted an 'init' event on a page client is currently connected to.
|
|
632
730
|
|
|
633
731
|
|
|
634
732
|
queueSteps(data) {
|
|
@@ -674,14 +772,16 @@ export class Provider extends Emitter {
|
|
|
674
772
|
json: steps,
|
|
675
773
|
version,
|
|
676
774
|
userIds: clientIds
|
|
677
|
-
}); // If steps can apply to local editor
|
|
775
|
+
}); // If steps can apply to local editor successfully, no need to accumulate the error counter.
|
|
678
776
|
|
|
679
777
|
this.stepRejectCounter = 0;
|
|
778
|
+
const measure = stopMeasure(MEASURE_NAME.ADD_STEPS);
|
|
680
779
|
triggerCollabAnalyticsEvent({
|
|
681
780
|
eventAction: EVENT_ACTION.ADD_STEPS,
|
|
682
781
|
attributes: {
|
|
683
782
|
eventStatus: EVENT_STATUS.SUCCESS,
|
|
684
|
-
documentAri: this.config.documentAri
|
|
783
|
+
documentAri: this.config.documentAri,
|
|
784
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
685
785
|
}
|
|
686
786
|
}, this.analyticsClient);
|
|
687
787
|
this.emitTelepointersFromSteps(steps); // Resend local steps if none of the received steps originated with us!
|
|
@@ -801,5 +901,9 @@ export class Provider extends Emitter {
|
|
|
801
901
|
this.channel.disconnect();
|
|
802
902
|
return this;
|
|
803
903
|
}
|
|
904
|
+
/**
|
|
905
|
+
* ESS-2916 namespace status event- lock/unlock
|
|
906
|
+
*/
|
|
907
|
+
|
|
804
908
|
|
|
805
909
|
}
|
|
@@ -11,6 +11,7 @@ export function createSocketIOSocket(url, auth, productInfo) {
|
|
|
11
11
|
reconnectionDelayMax: SOCKET_IO_OPTIONS.RECONNECTION_DELAY_MAX,
|
|
12
12
|
reconnectionDelay: SOCKET_IO_OPTIONS.RECONNECTION_DELAY,
|
|
13
13
|
randomizationFactor: SOCKET_IO_OPTIONS.RANDOMIZATION_FACTOR,
|
|
14
|
+
closeOnBeforeunload: false,
|
|
14
15
|
withCredentials: true,
|
|
15
16
|
transports: ['polling', 'websocket'],
|
|
16
17
|
path: `/${pathname.split('/')[1]}/socket.io`,
|
package/dist/es2019/version.json
CHANGED
|
@@ -4,7 +4,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
4
4
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { EVENT_SUBJECT, COLLAB_SERVICE } from '../helpers/const';
|
|
8
|
+
import { name as packageName, version as packageVersion } from '../version-wrapper';
|
|
8
9
|
export var fireAnalyticsEvent = function fireAnalyticsEvent(analyticsClient, payload) {
|
|
9
10
|
if (!analyticsClient || !payload) {
|
|
10
11
|
return;
|
|
@@ -30,7 +31,8 @@ export var triggerCollabAnalyticsEvent = function triggerCollabAnalyticsEvent(an
|
|
|
30
31
|
actionSubject: EVENT_SUBJECT,
|
|
31
32
|
source: 'unknown',
|
|
32
33
|
attributes: _objectSpread({
|
|
33
|
-
packageName:
|
|
34
|
+
packageName: packageName,
|
|
35
|
+
packageVersion: packageVersion,
|
|
34
36
|
collabService: COLLAB_SERVICE.NCS
|
|
35
37
|
}, analyticsEvent.attributes)
|
|
36
38
|
};
|
|
@@ -5,6 +5,8 @@ export var MEASURE_NAME;
|
|
|
5
5
|
MEASURE_NAME["SOCKET_CONNECT"] = "socketConnect";
|
|
6
6
|
MEASURE_NAME["DOCUMENT_INIT"] = "documentInit";
|
|
7
7
|
MEASURE_NAME["CONVERT_PM_TO_ADF"] = "convertPMToADF";
|
|
8
|
+
MEASURE_NAME["ADD_STEPS"] = "addSteps";
|
|
9
|
+
MEASURE_NAME["COMMIT_UNCONFIRMED_STEPS"] = "commitUnconfirmedSteps";
|
|
8
10
|
})(MEASURE_NAME || (MEASURE_NAME = {}));
|
|
9
11
|
|
|
10
12
|
var isPerformanceAPIAvailable = function isPerformanceAPIAvailable() {
|
package/dist/esm/channel.js
CHANGED
|
@@ -102,6 +102,19 @@ export var Channel = /*#__PURE__*/function (_Emitter) {
|
|
|
102
102
|
userId: userId,
|
|
103
103
|
metadata: metadata
|
|
104
104
|
});
|
|
105
|
+
} else {
|
|
106
|
+
// Page is been just restored, need to fix all the participants as well.
|
|
107
|
+
var _doc = data.doc,
|
|
108
|
+
_version = data.version,
|
|
109
|
+
_userId = data.userId,
|
|
110
|
+
_metadata = data.metadata;
|
|
111
|
+
|
|
112
|
+
_this.emit('restore', {
|
|
113
|
+
doc: _doc,
|
|
114
|
+
version: _version,
|
|
115
|
+
userId: _userId,
|
|
116
|
+
metadata: _metadata
|
|
117
|
+
});
|
|
105
118
|
}
|
|
106
119
|
} else {
|
|
107
120
|
_this.emit('steps:added', data);
|
|
@@ -201,6 +214,10 @@ export var Channel = /*#__PURE__*/function (_Emitter) {
|
|
|
201
214
|
});
|
|
202
215
|
this.socket.on('metadata:changed', function (payload) {
|
|
203
216
|
_this2.emit('metadata:changed', payload);
|
|
217
|
+
}); // ESS-2916 namespace status event - lock/unlock
|
|
218
|
+
|
|
219
|
+
this.socket.on('status', function (data) {
|
|
220
|
+
_this2.emit('status', data);
|
|
204
221
|
});
|
|
205
222
|
this.socket.on('disconnect', /*#__PURE__*/function () {
|
|
206
223
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(reason) {
|
package/dist/esm/config.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export var ATTRIBUTES_PACKAGE = 'collabProvider';
|
|
2
1
|
export var EVENT_SUBJECT = 'collab';
|
|
3
2
|
export var COLLAB_SERVICE;
|
|
4
3
|
|
|
@@ -16,6 +15,8 @@ export var EVENT_ACTION;
|
|
|
16
15
|
EVENT_ACTION["ADD_STEPS"] = "addSteps";
|
|
17
16
|
EVENT_ACTION["CONVERT_PM_TO_ADF"] = "convertPMToADF";
|
|
18
17
|
EVENT_ACTION["UPDATE_PARTICIPANTS"] = "updateParticipants";
|
|
18
|
+
EVENT_ACTION["COMMIT_UNCONFIRMED_STEPS"] = "commitUnconfirmedSteps";
|
|
19
|
+
EVENT_ACTION["REINITIALISE_DOCUMENT"] = "reinitialiseDocument";
|
|
19
20
|
})(EVENT_ACTION || (EVENT_ACTION = {}));
|
|
20
21
|
|
|
21
22
|
export var EVENT_STATUS;
|
|
@@ -25,4 +26,4 @@ export var EVENT_STATUS;
|
|
|
25
26
|
EVENT_STATUS["FAILURE"] = "FAILURE";
|
|
26
27
|
})(EVENT_STATUS || (EVENT_STATUS = {}));
|
|
27
28
|
|
|
28
|
-
export var ACK_MAX_TRY =
|
|
29
|
+
export var ACK_MAX_TRY = 30;
|