@atlaskit/collab-provider 10.16.2 → 10.16.3
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 +6 -0
- package/dist/cjs/participants/participants-service.js +27 -16
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/participants/participants-service.js +8 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/participants/participants-service.js +27 -16
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/participants/participants-service.d.ts +1 -0
- package/dist/types-ts4.5/participants/participants-service.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -60,6 +60,7 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
60
60
|
var getAIProviderActiveIds = arguments.length > 9 ? arguments[9] : undefined;
|
|
61
61
|
(0, _classCallCheck2.default)(this, ParticipantsService);
|
|
62
62
|
(0, _defineProperty2.default)(this, "currentlyPollingFetchUsers", true);
|
|
63
|
+
(0, _defineProperty2.default)(this, "hasBatchFetchError", false);
|
|
63
64
|
(0, _defineProperty2.default)(this, "sendPresenceActivityChanged", function () {
|
|
64
65
|
_this.sendPresence();
|
|
65
66
|
});
|
|
@@ -394,14 +395,15 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
394
395
|
joined: participants
|
|
395
396
|
}, 'handling participant updated event');
|
|
396
397
|
}
|
|
397
|
-
_context3.next =
|
|
398
|
+
_context3.next = 12;
|
|
398
399
|
break;
|
|
399
400
|
case 7:
|
|
400
401
|
_context3.prev = 7;
|
|
401
402
|
_context3.t0 = _context3["catch"](0);
|
|
402
403
|
(_props$onError = props.onError) === null || _props$onError === void 0 || _props$onError.call(props, _context3.t0);
|
|
404
|
+
_this.hasBatchFetchError = true;
|
|
403
405
|
(_this$analyticsHelper4 = _this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 || _this$analyticsHelper4.sendErrorEvent(_context3.t0, 'Failed while fetching participants');
|
|
404
|
-
case
|
|
406
|
+
case 12:
|
|
405
407
|
case "end":
|
|
406
408
|
return _context3.stop();
|
|
407
409
|
}
|
|
@@ -434,49 +436,58 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
434
436
|
}
|
|
435
437
|
return _context4.abrupt("return");
|
|
436
438
|
case 2:
|
|
439
|
+
if (!_this.hasBatchFetchError) {
|
|
440
|
+
_context4.next = 6;
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
// no retry logic yet
|
|
444
|
+
logger('Cannot continue to fetch users due to fetch error');
|
|
445
|
+
clearTimeout(_this.presenceFetchTimeout);
|
|
446
|
+
return _context4.abrupt("return");
|
|
447
|
+
case 6:
|
|
437
448
|
_this.currentlyPollingFetchUsers = true;
|
|
438
449
|
clearTimeout(_this.presenceFetchTimeout);
|
|
439
450
|
_this$batchProps = _this.batchProps, debounceTime = _this$batchProps.debounceTime, participantsLimit = _this$batchProps.participantsLimit;
|
|
440
451
|
if (!participantsLimit) {
|
|
441
|
-
_context4.next =
|
|
452
|
+
_context4.next = 20;
|
|
442
453
|
break;
|
|
443
454
|
}
|
|
444
455
|
size = _this.participantsState.getUniqueParticipants({
|
|
445
456
|
isHydrated: true
|
|
446
457
|
}).length;
|
|
447
458
|
if (!(size < participantsLimit)) {
|
|
448
|
-
_context4.next =
|
|
459
|
+
_context4.next = 17;
|
|
449
460
|
break;
|
|
450
461
|
}
|
|
451
|
-
_context4.next =
|
|
462
|
+
_context4.next = 14;
|
|
452
463
|
return _this.enrichParticipants(_objectSpread(_objectSpread({}, _this.batchProps), {}, {
|
|
453
464
|
batchSize: participantsLimit
|
|
454
465
|
}));
|
|
455
|
-
case
|
|
466
|
+
case 14:
|
|
456
467
|
_this.currentlyPollingFetchUsers = _this.participantsState.hasMoreParticipantsToHydrate();
|
|
457
|
-
_context4.next =
|
|
468
|
+
_context4.next = 18;
|
|
458
469
|
break;
|
|
459
|
-
case
|
|
470
|
+
case 17:
|
|
460
471
|
_this.currentlyPollingFetchUsers = false;
|
|
461
|
-
case
|
|
462
|
-
_context4.next =
|
|
472
|
+
case 18:
|
|
473
|
+
_context4.next = 24;
|
|
463
474
|
break;
|
|
464
|
-
case
|
|
475
|
+
case 20:
|
|
465
476
|
if (participantsLimit) {
|
|
466
|
-
_context4.next =
|
|
477
|
+
_context4.next = 24;
|
|
467
478
|
break;
|
|
468
479
|
}
|
|
469
|
-
_context4.next =
|
|
480
|
+
_context4.next = 23;
|
|
470
481
|
return _this.enrichParticipants(_this.batchProps);
|
|
471
|
-
case
|
|
482
|
+
case 23:
|
|
472
483
|
_this.currentlyPollingFetchUsers = _this.participantsState.hasMoreParticipantsToHydrate();
|
|
473
|
-
case
|
|
484
|
+
case 24:
|
|
474
485
|
if (_this.currentlyPollingFetchUsers) {
|
|
475
486
|
_this.presenceFetchTimeout = window.setTimeout(function () {
|
|
476
487
|
return _this.batchFetchUsers();
|
|
477
488
|
}, debounceTime !== null && debounceTime !== void 0 ? debounceTime : DEFAULT_FETCH_USERS_INTERVAL);
|
|
478
489
|
}
|
|
479
|
-
case
|
|
490
|
+
case 25:
|
|
480
491
|
case "end":
|
|
481
492
|
return _context4.stop();
|
|
482
493
|
}
|
|
@@ -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 = "10.16.
|
|
8
|
+
var version = exports.version = "10.16.3";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -36,6 +36,7 @@ export class ParticipantsService {
|
|
|
36
36
|
*/
|
|
37
37
|
constructor(analyticsHelper, participantsState = new ParticipantsState(), emit, getUser, batchProps, channelBroadcast, sendPresenceJoined, getPresenceData, setUserId, getAIProviderActiveIds) {
|
|
38
38
|
_defineProperty(this, "currentlyPollingFetchUsers", true);
|
|
39
|
+
_defineProperty(this, "hasBatchFetchError", false);
|
|
39
40
|
_defineProperty(this, "sendPresenceActivityChanged", () => {
|
|
40
41
|
this.sendPresence();
|
|
41
42
|
});
|
|
@@ -327,6 +328,7 @@ export class ParticipantsService {
|
|
|
327
328
|
} catch (err) {
|
|
328
329
|
var _props$onError, _this$analyticsHelper4;
|
|
329
330
|
(_props$onError = props.onError) === null || _props$onError === void 0 ? void 0 : _props$onError.call(props, err);
|
|
331
|
+
this.hasBatchFetchError = true;
|
|
330
332
|
(_this$analyticsHelper4 = this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 ? void 0 : _this$analyticsHelper4.sendErrorEvent(err, 'Failed while fetching participants');
|
|
331
333
|
}
|
|
332
334
|
});
|
|
@@ -346,6 +348,12 @@ export class ParticipantsService {
|
|
|
346
348
|
if (!this.batchProps) {
|
|
347
349
|
return;
|
|
348
350
|
}
|
|
351
|
+
if (this.hasBatchFetchError) {
|
|
352
|
+
// no retry logic yet
|
|
353
|
+
logger('Cannot continue to fetch users due to fetch error');
|
|
354
|
+
clearTimeout(this.presenceFetchTimeout);
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
349
357
|
this.currentlyPollingFetchUsers = true;
|
|
350
358
|
clearTimeout(this.presenceFetchTimeout);
|
|
351
359
|
const {
|
|
@@ -53,6 +53,7 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
53
53
|
var getAIProviderActiveIds = arguments.length > 9 ? arguments[9] : undefined;
|
|
54
54
|
_classCallCheck(this, ParticipantsService);
|
|
55
55
|
_defineProperty(this, "currentlyPollingFetchUsers", true);
|
|
56
|
+
_defineProperty(this, "hasBatchFetchError", false);
|
|
56
57
|
_defineProperty(this, "sendPresenceActivityChanged", function () {
|
|
57
58
|
_this.sendPresence();
|
|
58
59
|
});
|
|
@@ -387,14 +388,15 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
387
388
|
joined: participants
|
|
388
389
|
}, 'handling participant updated event');
|
|
389
390
|
}
|
|
390
|
-
_context3.next =
|
|
391
|
+
_context3.next = 12;
|
|
391
392
|
break;
|
|
392
393
|
case 7:
|
|
393
394
|
_context3.prev = 7;
|
|
394
395
|
_context3.t0 = _context3["catch"](0);
|
|
395
396
|
(_props$onError = props.onError) === null || _props$onError === void 0 || _props$onError.call(props, _context3.t0);
|
|
397
|
+
_this.hasBatchFetchError = true;
|
|
396
398
|
(_this$analyticsHelper4 = _this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 || _this$analyticsHelper4.sendErrorEvent(_context3.t0, 'Failed while fetching participants');
|
|
397
|
-
case
|
|
399
|
+
case 12:
|
|
398
400
|
case "end":
|
|
399
401
|
return _context3.stop();
|
|
400
402
|
}
|
|
@@ -427,49 +429,58 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
427
429
|
}
|
|
428
430
|
return _context4.abrupt("return");
|
|
429
431
|
case 2:
|
|
432
|
+
if (!_this.hasBatchFetchError) {
|
|
433
|
+
_context4.next = 6;
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
// no retry logic yet
|
|
437
|
+
logger('Cannot continue to fetch users due to fetch error');
|
|
438
|
+
clearTimeout(_this.presenceFetchTimeout);
|
|
439
|
+
return _context4.abrupt("return");
|
|
440
|
+
case 6:
|
|
430
441
|
_this.currentlyPollingFetchUsers = true;
|
|
431
442
|
clearTimeout(_this.presenceFetchTimeout);
|
|
432
443
|
_this$batchProps = _this.batchProps, debounceTime = _this$batchProps.debounceTime, participantsLimit = _this$batchProps.participantsLimit;
|
|
433
444
|
if (!participantsLimit) {
|
|
434
|
-
_context4.next =
|
|
445
|
+
_context4.next = 20;
|
|
435
446
|
break;
|
|
436
447
|
}
|
|
437
448
|
size = _this.participantsState.getUniqueParticipants({
|
|
438
449
|
isHydrated: true
|
|
439
450
|
}).length;
|
|
440
451
|
if (!(size < participantsLimit)) {
|
|
441
|
-
_context4.next =
|
|
452
|
+
_context4.next = 17;
|
|
442
453
|
break;
|
|
443
454
|
}
|
|
444
|
-
_context4.next =
|
|
455
|
+
_context4.next = 14;
|
|
445
456
|
return _this.enrichParticipants(_objectSpread(_objectSpread({}, _this.batchProps), {}, {
|
|
446
457
|
batchSize: participantsLimit
|
|
447
458
|
}));
|
|
448
|
-
case
|
|
459
|
+
case 14:
|
|
449
460
|
_this.currentlyPollingFetchUsers = _this.participantsState.hasMoreParticipantsToHydrate();
|
|
450
|
-
_context4.next =
|
|
461
|
+
_context4.next = 18;
|
|
451
462
|
break;
|
|
452
|
-
case
|
|
463
|
+
case 17:
|
|
453
464
|
_this.currentlyPollingFetchUsers = false;
|
|
454
|
-
case
|
|
455
|
-
_context4.next =
|
|
465
|
+
case 18:
|
|
466
|
+
_context4.next = 24;
|
|
456
467
|
break;
|
|
457
|
-
case
|
|
468
|
+
case 20:
|
|
458
469
|
if (participantsLimit) {
|
|
459
|
-
_context4.next =
|
|
470
|
+
_context4.next = 24;
|
|
460
471
|
break;
|
|
461
472
|
}
|
|
462
|
-
_context4.next =
|
|
473
|
+
_context4.next = 23;
|
|
463
474
|
return _this.enrichParticipants(_this.batchProps);
|
|
464
|
-
case
|
|
475
|
+
case 23:
|
|
465
476
|
_this.currentlyPollingFetchUsers = _this.participantsState.hasMoreParticipantsToHydrate();
|
|
466
|
-
case
|
|
477
|
+
case 24:
|
|
467
478
|
if (_this.currentlyPollingFetchUsers) {
|
|
468
479
|
_this.presenceFetchTimeout = window.setTimeout(function () {
|
|
469
480
|
return _this.batchFetchUsers();
|
|
470
481
|
}, debounceTime !== null && debounceTime !== void 0 ? debounceTime : DEFAULT_FETCH_USERS_INTERVAL);
|
|
471
482
|
}
|
|
472
|
-
case
|
|
483
|
+
case 25:
|
|
473
484
|
case "end":
|
|
474
485
|
return _context4.stop();
|
|
475
486
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/collab-provider",
|
|
3
|
-
"version": "10.16.
|
|
3
|
+
"version": "10.16.3",
|
|
4
4
|
"description": "A provider for collaborative editing.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
41
41
|
"@atlaskit/feature-gate-js-client": "^5.3.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
43
|
-
"@atlaskit/prosemirror-collab": "^0.
|
|
43
|
+
"@atlaskit/prosemirror-collab": "^0.17.0",
|
|
44
44
|
"@atlaskit/react-ufo": "^3.13.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^5.
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^5.5.0",
|
|
46
46
|
"@atlaskit/ufo": "^0.4.0",
|
|
47
47
|
"@atlaskit/util-service-support": "^6.3.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|