@atlaskit/collab-provider 9.17.2 → 9.17.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 9.17.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#56940](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/56940) [`e862ee8c3290`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e862ee8c3290) - Add success analytics for updating document
8
+ - [#57024](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/57024) [`4807b15145e2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4807b15145e2) - Update commented link for update document action
9
+
3
10
  ## 9.17.2
4
11
 
5
12
  ### Patch Changes
@@ -353,10 +353,13 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
353
353
  }, reserveCursor ? {
354
354
  reserveCursor: reserveCursor
355
355
  } : {}));
356
+ _this.updateDocumentAnalytics(doc, version);
357
+ });
358
+ (0, _defineProperty2.default)(this, "updateDocumentAnalytics", function (doc, version) {
356
359
  var updatedVersion = _this.getCurrentPmVersion();
360
+ var isDocContentValid = _this.validatePMJSONDocument(doc);
357
361
  if (_this.getCurrentPmVersion() !== version) {
358
362
  var _doc$content, _this$analyticsHelper17;
359
- var isDocContentValid = _this.validatePMJSONDocument(doc);
360
363
  var _error = new _errorTypes.UpdateDocumentError('Failed to update the document', {
361
364
  newVersion: version,
362
365
  editorVersion: updatedVersion,
@@ -380,14 +383,23 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
380
383
  throw _error;
381
384
  }
382
385
  // Otherwise just fail silently for now
386
+ } else {
387
+ var _this$analyticsHelper18, _doc$content2;
388
+ (_this$analyticsHelper18 = _this.analyticsHelper) === null || _this$analyticsHelper18 === void 0 || _this$analyticsHelper18.sendActionEvent(_const.EVENT_ACTION.UPDATE_DOCUMENT, _const.EVENT_STATUS.SUCCESS, {
389
+ newVersion: version,
390
+ editorVersion: updatedVersion,
391
+ isDocTruthy: !!doc,
392
+ docHasContent: (doc === null || doc === void 0 || (_doc$content2 = doc.content) === null || _doc$content2 === void 0 ? void 0 : _doc$content2.length) >= 1,
393
+ isDocContentValid: isDocContentValid
394
+ });
383
395
  }
384
396
  });
385
397
  (0, _defineProperty2.default)(this, "validatePMJSONDocument", function (doc) {
386
398
  try {
387
399
  var _this$getState5;
388
400
  if (!((_this$getState5 = _this.getState) !== null && _this$getState5 !== void 0 && _this$getState5.call(_this))) {
389
- var _this$analyticsHelper18;
390
- (_this$analyticsHelper18 = _this.analyticsHelper) === null || _this$analyticsHelper18 === void 0 || _this$analyticsHelper18.sendErrorEvent(new Error('Editor state is undefined'), 'validatePMJSONDocument called without state');
401
+ var _this$analyticsHelper19;
402
+ (_this$analyticsHelper19 = _this.analyticsHelper) === null || _this$analyticsHelper19 === void 0 || _this$analyticsHelper19.sendErrorEvent(new Error('Editor state is undefined'), 'validatePMJSONDocument called without state');
391
403
  }
392
404
  var state = _this.getState();
393
405
  var content = (doc.content || []).map(function (child) {
@@ -410,7 +422,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
410
422
  * @throws {Error} Couldn't sync the steps after retrying 30 times
411
423
  */
412
424
  (0, _defineProperty2.default)(this, "commitUnconfirmedSteps", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
413
- var unconfirmedSteps, _this$getState6, _this$analyticsHelper20, count, unconfirmedTrs, lastTr, isLastTrConfirmed, _this$analyticsHelper19, nextUnconfirmedSteps, nextUnconfirmedTrs, _this$getUnconfirmedS, state, unconfirmedStepsInfoUGCRemoved, _error2, measure, _this$analyticsHelper21, _this$analyticsHelper22, _measure3;
425
+ var unconfirmedSteps, _this$getState6, _this$analyticsHelper21, count, unconfirmedTrs, lastTr, isLastTrConfirmed, _this$analyticsHelper20, nextUnconfirmedSteps, nextUnconfirmedTrs, _this$getUnconfirmedS, state, unconfirmedStepsInfoUGCRemoved, _error2, measure, _this$analyticsHelper22, _this$analyticsHelper23, _measure3;
414
426
  return _regenerator.default.wrap(function _callee4$(_context4) {
415
427
  while (1) switch (_context4.prev = _context4.next) {
416
428
  case 0:
@@ -429,7 +441,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
429
441
  lastTr = unconfirmedTrs === null || unconfirmedTrs === void 0 ? void 0 : unconfirmedTrs[unconfirmedTrs.length - 1];
430
442
  isLastTrConfirmed = false;
431
443
  if (!((_this$getState6 = _this.getState) !== null && _this$getState6 !== void 0 && _this$getState6.call(_this))) {
432
- (_this$analyticsHelper19 = _this.analyticsHelper) === null || _this$analyticsHelper19 === void 0 || _this$analyticsHelper19.sendErrorEvent(new Error('Editor state is undefined'), 'commitUnconfirmedSteps called without state');
444
+ (_this$analyticsHelper20 = _this.analyticsHelper) === null || _this$analyticsHelper20 === void 0 || _this$analyticsHelper20.sendErrorEvent(new Error('Editor state is undefined'), 'commitUnconfirmedSteps called without state');
433
445
  }
434
446
  case 9:
435
447
  if (isLastTrConfirmed) {
@@ -475,7 +487,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
475
487
  break;
476
488
  case 22:
477
489
  measure = (0, _performance.stopMeasure)(_performance.MEASURE_NAME.COMMIT_UNCONFIRMED_STEPS, _this.analyticsHelper);
478
- (_this$analyticsHelper20 = _this.analyticsHelper) === null || _this$analyticsHelper20 === void 0 || _this$analyticsHelper20.sendActionEvent(_const.EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, _const.EVENT_STATUS.SUCCESS, {
490
+ (_this$analyticsHelper21 = _this.analyticsHelper) === null || _this$analyticsHelper21 === void 0 || _this$analyticsHelper21.sendActionEvent(_const.EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, _const.EVENT_STATUS.SUCCESS, {
479
491
  latency: measure === null || measure === void 0 ? void 0 : measure.duration,
480
492
  // upon success, emit the total number of unconfirmed steps we synced
481
493
  numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length
@@ -487,11 +499,11 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
487
499
  _context4.prev = 26;
488
500
  _context4.t0 = _context4["catch"](1);
489
501
  _measure3 = (0, _performance.stopMeasure)(_performance.MEASURE_NAME.COMMIT_UNCONFIRMED_STEPS, _this.analyticsHelper);
490
- (_this$analyticsHelper21 = _this.analyticsHelper) === null || _this$analyticsHelper21 === void 0 || _this$analyticsHelper21.sendActionEvent(_const.EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, _const.EVENT_STATUS.FAILURE, {
502
+ (_this$analyticsHelper22 = _this.analyticsHelper) === null || _this$analyticsHelper22 === void 0 || _this$analyticsHelper22.sendActionEvent(_const.EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, _const.EVENT_STATUS.FAILURE, {
491
503
  latency: _measure3 === null || _measure3 === void 0 ? void 0 : _measure3.duration,
492
504
  numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length
493
505
  });
494
- (_this$analyticsHelper22 = _this.analyticsHelper) === null || _this$analyticsHelper22 === void 0 || _this$analyticsHelper22.sendErrorEvent(_context4.t0, 'Error while committing unconfirmed steps');
506
+ (_this$analyticsHelper23 = _this.analyticsHelper) === null || _this$analyticsHelper23 === void 0 || _this$analyticsHelper23.sendErrorEvent(_context4.t0, 'Error while committing unconfirmed steps');
495
507
  throw _context4.t0;
496
508
  case 32:
497
509
  case "end":
@@ -500,17 +512,17 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
500
512
  }, _callee4, null, [[1, 26]]);
501
513
  })));
502
514
  (0, _defineProperty2.default)(this, "onStepRejectedError", function () {
503
- var _this$analyticsHelper23;
515
+ var _this$analyticsHelper24;
504
516
  _this.stepRejectCounter++;
505
517
  logger("Steps rejected (tries=".concat(_this.stepRejectCounter, ")"));
506
- (_this$analyticsHelper23 = _this.analyticsHelper) === null || _this$analyticsHelper23 === void 0 || _this$analyticsHelper23.sendActionEvent(_const.EVENT_ACTION.SEND_STEPS_RETRY, _const.EVENT_STATUS.INFO, {
518
+ (_this$analyticsHelper24 = _this.analyticsHelper) === null || _this$analyticsHelper24 === void 0 || _this$analyticsHelper24.sendActionEvent(_const.EVENT_ACTION.SEND_STEPS_RETRY, _const.EVENT_STATUS.INFO, {
507
519
  count: _this.stepRejectCounter
508
520
  });
509
521
  var maxRetries = _this.aggressiveCatchup ? _provider.MAX_STEP_REJECTED_ERROR_AGGRESSIVE : _provider.MAX_STEP_REJECTED_ERROR;
510
522
  if (_this.stepRejectCounter >= maxRetries) {
511
- var _this$analyticsHelper24;
523
+ var _this$analyticsHelper25;
512
524
  logger("The steps were rejected too many times (tries=".concat(_this.stepRejectCounter, ", limit=").concat(_provider.MAX_STEP_REJECTED_ERROR, "). Trying to catch-up."));
513
- (_this$analyticsHelper24 = _this.analyticsHelper) === null || _this$analyticsHelper24 === void 0 || _this$analyticsHelper24.sendActionEvent(_const.EVENT_ACTION.CATCHUP_AFTER_MAX_SEND_STEPS_RETRY, _const.EVENT_STATUS.INFO);
525
+ (_this$analyticsHelper25 = _this.analyticsHelper) === null || _this$analyticsHelper25 === void 0 || _this$analyticsHelper25.sendActionEvent(_const.EVENT_ACTION.CATCHUP_AFTER_MAX_SEND_STEPS_RETRY, _const.EVENT_STATUS.INFO);
514
526
  _this.throttledCatchup();
515
527
  } else {
516
528
  // If committing steps failed try again automatically in 1s
@@ -584,9 +596,9 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
584
596
  }, 100);
585
597
  }
586
598
  } catch (error) {
587
- var _this$analyticsHelper25;
599
+ var _this$analyticsHelper26;
588
600
  logger("Processing steps failed with error: ".concat(error, ". Triggering catch up call."));
589
- (_this$analyticsHelper25 = this.analyticsHelper) === null || _this$analyticsHelper25 === void 0 || _this$analyticsHelper25.sendErrorEvent(error, 'Error while processing steps');
601
+ (_this$analyticsHelper26 = this.analyticsHelper) === null || _this$analyticsHelper26 === void 0 || _this$analyticsHelper26.sendErrorEvent(error, 'Error while processing steps');
590
602
  this.throttledCatchup();
591
603
  }
592
604
  }
@@ -616,8 +628,8 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
616
628
  var _this$getState7;
617
629
  var state = (_this$getState7 = this.getState) === null || _this$getState7 === void 0 ? void 0 : _this$getState7.call(this);
618
630
  if (!state) {
619
- var _this$analyticsHelper26;
620
- (_this$analyticsHelper26 = this.analyticsHelper) === null || _this$analyticsHelper26 === void 0 || _this$analyticsHelper26.sendErrorEvent(new Error('Editor state is undefined'), 'sendStepsFromCurrentState called without state');
631
+ var _this$analyticsHelper27;
632
+ (_this$analyticsHelper27 = this.analyticsHelper) === null || _this$analyticsHelper27 === void 0 || _this$analyticsHelper27.sendErrorEvent(new Error('Editor state is undefined'), 'sendStepsFromCurrentState called without state');
621
633
  return;
622
634
  }
623
635
  this.send(null, null, state, sendAnalyticsEvent);
@@ -642,8 +654,8 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
642
654
  // to ensure that analytics events with the number of unconfirmed steps is only
643
655
  // sent once on connection (as opposed to on every step)
644
656
  if (sendAnalyticsEvent) {
645
- var _this$analyticsHelper27;
646
- (_this$analyticsHelper27 = this.analyticsHelper) === null || _this$analyticsHelper27 === void 0 || _this$analyticsHelper27.sendActionEvent(_const.EVENT_ACTION.HAS_UNCONFIRMED_STEPS, _const.EVENT_STATUS.INFO, {
657
+ var _this$analyticsHelper28;
658
+ (_this$analyticsHelper28 = this.analyticsHelper) === null || _this$analyticsHelper28 === void 0 || _this$analyticsHelper28.sendActionEvent(_const.EVENT_ACTION.HAS_UNCONFIRMED_STEPS, _const.EVENT_STATUS.INFO, {
647
659
  numUnconfirmedSteps: (unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length) || 0
648
660
  });
649
661
  }
@@ -654,8 +666,8 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
654
666
  // This is where we would call the sendStepsQueue instead of throttledCommitStep
655
667
  // Only send 1% of events to avoid useless logging
656
668
  if (Math.random() < 0.01) {
657
- var _this$analyticsHelper28;
658
- (_this$analyticsHelper28 = this.analyticsHelper) === null || _this$analyticsHelper28 === void 0 || _this$analyticsHelper28.sendActionEvent(_const.EVENT_ACTION.SEND_STEPS_QUEUE, _const.EVENT_STATUS.INFO);
669
+ var _this$analyticsHelper29;
670
+ (_this$analyticsHelper29 = this.analyticsHelper) === null || _this$analyticsHelper29 === void 0 || _this$analyticsHelper29.sendActionEvent(_const.EVENT_ACTION.SEND_STEPS_QUEUE, _const.EVENT_STATUS.INFO);
659
671
  }
660
672
  // Avoid reference issues using a
661
673
  // method outside of the provider
@@ -10,6 +10,7 @@ var EVENT_ACTION = exports.EVENT_ACTION = /*#__PURE__*/function (EVENT_ACTION) {
10
10
  EVENT_ACTION["DOCUMENT_INIT"] = "documentInit";
11
11
  EVENT_ACTION["ADD_STEPS"] = "addSteps";
12
12
  EVENT_ACTION["UPDATE_PARTICIPANTS"] = "updateParticipants";
13
+ EVENT_ACTION["UPDATE_DOCUMENT"] = "updateDocument";
13
14
  EVENT_ACTION["COMMIT_UNCONFIRMED_STEPS"] = "commitUnconfirmedSteps";
14
15
  EVENT_ACTION["REINITIALISE_DOCUMENT"] = "reinitialiseDocument";
15
16
  EVENT_ACTION["ERROR"] = "error";
@@ -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.17.2";
8
+ var version = exports.version = "9.17.3";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -292,10 +292,13 @@ export class DocumentService {
292
292
  reserveCursor
293
293
  } : {})
294
294
  });
295
+ this.updateDocumentAnalytics(doc, version);
296
+ });
297
+ _defineProperty(this, "updateDocumentAnalytics", (doc, version) => {
295
298
  const updatedVersion = this.getCurrentPmVersion();
299
+ const isDocContentValid = this.validatePMJSONDocument(doc);
296
300
  if (this.getCurrentPmVersion() !== version) {
297
301
  var _doc$content, _this$analyticsHelper17;
298
- const isDocContentValid = this.validatePMJSONDocument(doc);
299
302
  const error = new UpdateDocumentError('Failed to update the document', {
300
303
  newVersion: version,
301
304
  editorVersion: updatedVersion,
@@ -319,14 +322,23 @@ export class DocumentService {
319
322
  throw error;
320
323
  }
321
324
  // Otherwise just fail silently for now
325
+ } else {
326
+ var _this$analyticsHelper18, _doc$content2;
327
+ (_this$analyticsHelper18 = this.analyticsHelper) === null || _this$analyticsHelper18 === void 0 ? void 0 : _this$analyticsHelper18.sendActionEvent(EVENT_ACTION.UPDATE_DOCUMENT, EVENT_STATUS.SUCCESS, {
328
+ newVersion: version,
329
+ editorVersion: updatedVersion,
330
+ isDocTruthy: !!doc,
331
+ docHasContent: (doc === null || doc === void 0 ? void 0 : (_doc$content2 = doc.content) === null || _doc$content2 === void 0 ? void 0 : _doc$content2.length) >= 1,
332
+ isDocContentValid
333
+ });
322
334
  }
323
335
  });
324
336
  _defineProperty(this, "validatePMJSONDocument", doc => {
325
337
  try {
326
338
  var _this$getState5;
327
339
  if (!((_this$getState5 = this.getState) !== null && _this$getState5 !== void 0 && _this$getState5.call(this))) {
328
- var _this$analyticsHelper18;
329
- (_this$analyticsHelper18 = this.analyticsHelper) === null || _this$analyticsHelper18 === void 0 ? void 0 : _this$analyticsHelper18.sendErrorEvent(new Error('Editor state is undefined'), 'validatePMJSONDocument called without state');
340
+ var _this$analyticsHelper19;
341
+ (_this$analyticsHelper19 = this.analyticsHelper) === null || _this$analyticsHelper19 === void 0 ? void 0 : _this$analyticsHelper19.sendErrorEvent(new Error('Editor state is undefined'), 'validatePMJSONDocument called without state');
330
342
  }
331
343
  const state = this.getState();
332
344
  const content = (doc.content || []).map(child => state.schema.nodeFromJSON(child));
@@ -350,7 +362,7 @@ export class DocumentService {
350
362
  const unconfirmedSteps = this.getUnconfirmedSteps();
351
363
  try {
352
364
  if (unconfirmedSteps !== null && unconfirmedSteps !== void 0 && unconfirmedSteps.length) {
353
- var _this$getState6, _this$analyticsHelper20;
365
+ var _this$getState6, _this$analyticsHelper21;
354
366
  startMeasure(MEASURE_NAME.COMMIT_UNCONFIRMED_STEPS, this.analyticsHelper);
355
367
  let count = 0;
356
368
  // We use origins here as steps can be rebased. When steps are rebased a new step is created.
@@ -361,8 +373,8 @@ export class DocumentService {
361
373
  const lastTr = unconfirmedTrs === null || unconfirmedTrs === void 0 ? void 0 : unconfirmedTrs[unconfirmedTrs.length - 1];
362
374
  let isLastTrConfirmed = false;
363
375
  if (!((_this$getState6 = this.getState) !== null && _this$getState6 !== void 0 && _this$getState6.call(this))) {
364
- var _this$analyticsHelper19;
365
- (_this$analyticsHelper19 = this.analyticsHelper) === null || _this$analyticsHelper19 === void 0 ? void 0 : _this$analyticsHelper19.sendErrorEvent(new Error('Editor state is undefined'), 'commitUnconfirmedSteps called without state');
376
+ var _this$analyticsHelper20;
377
+ (_this$analyticsHelper20 = this.analyticsHelper) === null || _this$analyticsHelper20 === void 0 ? void 0 : _this$analyticsHelper20.sendErrorEvent(new Error('Editor state is undefined'), 'commitUnconfirmedSteps called without state');
366
378
  }
367
379
  while (!isLastTrConfirmed) {
368
380
  this.sendStepsFromCurrentState();
@@ -394,35 +406,35 @@ export class DocumentService {
394
406
  }
395
407
  }
396
408
  const measure = stopMeasure(MEASURE_NAME.COMMIT_UNCONFIRMED_STEPS, this.analyticsHelper);
397
- (_this$analyticsHelper20 = this.analyticsHelper) === null || _this$analyticsHelper20 === void 0 ? void 0 : _this$analyticsHelper20.sendActionEvent(EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, EVENT_STATUS.SUCCESS, {
409
+ (_this$analyticsHelper21 = this.analyticsHelper) === null || _this$analyticsHelper21 === void 0 ? void 0 : _this$analyticsHelper21.sendActionEvent(EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, EVENT_STATUS.SUCCESS, {
398
410
  latency: measure === null || measure === void 0 ? void 0 : measure.duration,
399
411
  // upon success, emit the total number of unconfirmed steps we synced
400
412
  numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length
401
413
  });
402
414
  }
403
415
  } catch (error) {
404
- var _this$analyticsHelper21, _this$analyticsHelper22;
416
+ var _this$analyticsHelper22, _this$analyticsHelper23;
405
417
  const measure = stopMeasure(MEASURE_NAME.COMMIT_UNCONFIRMED_STEPS, this.analyticsHelper);
406
- (_this$analyticsHelper21 = this.analyticsHelper) === null || _this$analyticsHelper21 === void 0 ? void 0 : _this$analyticsHelper21.sendActionEvent(EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, EVENT_STATUS.FAILURE, {
418
+ (_this$analyticsHelper22 = this.analyticsHelper) === null || _this$analyticsHelper22 === void 0 ? void 0 : _this$analyticsHelper22.sendActionEvent(EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, EVENT_STATUS.FAILURE, {
407
419
  latency: measure === null || measure === void 0 ? void 0 : measure.duration,
408
420
  numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length
409
421
  });
410
- (_this$analyticsHelper22 = this.analyticsHelper) === null || _this$analyticsHelper22 === void 0 ? void 0 : _this$analyticsHelper22.sendErrorEvent(error, 'Error while committing unconfirmed steps');
422
+ (_this$analyticsHelper23 = this.analyticsHelper) === null || _this$analyticsHelper23 === void 0 ? void 0 : _this$analyticsHelper23.sendErrorEvent(error, 'Error while committing unconfirmed steps');
411
423
  throw error;
412
424
  }
413
425
  });
414
426
  _defineProperty(this, "onStepRejectedError", () => {
415
- var _this$analyticsHelper23;
427
+ var _this$analyticsHelper24;
416
428
  this.stepRejectCounter++;
417
429
  logger(`Steps rejected (tries=${this.stepRejectCounter})`);
418
- (_this$analyticsHelper23 = this.analyticsHelper) === null || _this$analyticsHelper23 === void 0 ? void 0 : _this$analyticsHelper23.sendActionEvent(EVENT_ACTION.SEND_STEPS_RETRY, EVENT_STATUS.INFO, {
430
+ (_this$analyticsHelper24 = this.analyticsHelper) === null || _this$analyticsHelper24 === void 0 ? void 0 : _this$analyticsHelper24.sendActionEvent(EVENT_ACTION.SEND_STEPS_RETRY, EVENT_STATUS.INFO, {
419
431
  count: this.stepRejectCounter
420
432
  });
421
433
  let maxRetries = this.aggressiveCatchup ? MAX_STEP_REJECTED_ERROR_AGGRESSIVE : MAX_STEP_REJECTED_ERROR;
422
434
  if (this.stepRejectCounter >= maxRetries) {
423
- var _this$analyticsHelper24;
435
+ var _this$analyticsHelper25;
424
436
  logger(`The steps were rejected too many times (tries=${this.stepRejectCounter}, limit=${MAX_STEP_REJECTED_ERROR}). Trying to catch-up.`);
425
- (_this$analyticsHelper24 = this.analyticsHelper) === null || _this$analyticsHelper24 === void 0 ? void 0 : _this$analyticsHelper24.sendActionEvent(EVENT_ACTION.CATCHUP_AFTER_MAX_SEND_STEPS_RETRY, EVENT_STATUS.INFO);
437
+ (_this$analyticsHelper25 = this.analyticsHelper) === null || _this$analyticsHelper25 === void 0 ? void 0 : _this$analyticsHelper25.sendActionEvent(EVENT_ACTION.CATCHUP_AFTER_MAX_SEND_STEPS_RETRY, EVENT_STATUS.INFO);
426
438
  this.throttledCatchup();
427
439
  } else {
428
440
  // If committing steps failed try again automatically in 1s
@@ -488,9 +500,9 @@ export class DocumentService {
488
500
  setTimeout(() => this.sendStepsFromCurrentState(), 100);
489
501
  }
490
502
  } catch (error) {
491
- var _this$analyticsHelper25;
503
+ var _this$analyticsHelper26;
492
504
  logger(`Processing steps failed with error: ${error}. Triggering catch up call.`);
493
- (_this$analyticsHelper25 = this.analyticsHelper) === null || _this$analyticsHelper25 === void 0 ? void 0 : _this$analyticsHelper25.sendErrorEvent(error, 'Error while processing steps');
505
+ (_this$analyticsHelper26 = this.analyticsHelper) === null || _this$analyticsHelper26 === void 0 ? void 0 : _this$analyticsHelper26.sendErrorEvent(error, 'Error while processing steps');
494
506
  this.throttledCatchup();
495
507
  }
496
508
  }
@@ -517,8 +529,8 @@ export class DocumentService {
517
529
  var _this$getState7;
518
530
  const state = (_this$getState7 = this.getState) === null || _this$getState7 === void 0 ? void 0 : _this$getState7.call(this);
519
531
  if (!state) {
520
- var _this$analyticsHelper26;
521
- (_this$analyticsHelper26 = this.analyticsHelper) === null || _this$analyticsHelper26 === void 0 ? void 0 : _this$analyticsHelper26.sendErrorEvent(new Error('Editor state is undefined'), 'sendStepsFromCurrentState called without state');
532
+ var _this$analyticsHelper27;
533
+ (_this$analyticsHelper27 = this.analyticsHelper) === null || _this$analyticsHelper27 === void 0 ? void 0 : _this$analyticsHelper27.sendErrorEvent(new Error('Editor state is undefined'), 'sendStepsFromCurrentState called without state');
522
534
  return;
523
535
  }
524
536
  this.send(null, null, state, sendAnalyticsEvent);
@@ -540,8 +552,8 @@ export class DocumentService {
540
552
  // to ensure that analytics events with the number of unconfirmed steps is only
541
553
  // sent once on connection (as opposed to on every step)
542
554
  if (sendAnalyticsEvent) {
543
- var _this$analyticsHelper27;
544
- (_this$analyticsHelper27 = this.analyticsHelper) === null || _this$analyticsHelper27 === void 0 ? void 0 : _this$analyticsHelper27.sendActionEvent(EVENT_ACTION.HAS_UNCONFIRMED_STEPS, EVENT_STATUS.INFO, {
555
+ var _this$analyticsHelper28;
556
+ (_this$analyticsHelper28 = this.analyticsHelper) === null || _this$analyticsHelper28 === void 0 ? void 0 : _this$analyticsHelper28.sendActionEvent(EVENT_ACTION.HAS_UNCONFIRMED_STEPS, EVENT_STATUS.INFO, {
545
557
  numUnconfirmedSteps: (unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length) || 0
546
558
  });
547
559
  }
@@ -552,8 +564,8 @@ export class DocumentService {
552
564
  // This is where we would call the sendStepsQueue instead of throttledCommitStep
553
565
  // Only send 1% of events to avoid useless logging
554
566
  if (Math.random() < 0.01) {
555
- var _this$analyticsHelper28;
556
- (_this$analyticsHelper28 = this.analyticsHelper) === null || _this$analyticsHelper28 === void 0 ? void 0 : _this$analyticsHelper28.sendActionEvent(EVENT_ACTION.SEND_STEPS_QUEUE, EVENT_STATUS.INFO);
567
+ var _this$analyticsHelper29;
568
+ (_this$analyticsHelper29 = this.analyticsHelper) === null || _this$analyticsHelper29 === void 0 ? void 0 : _this$analyticsHelper29.sendActionEvent(EVENT_ACTION.SEND_STEPS_QUEUE, EVENT_STATUS.INFO);
557
569
  }
558
570
  // Avoid reference issues using a
559
571
  // method outside of the provider
@@ -4,6 +4,7 @@ export let EVENT_ACTION = /*#__PURE__*/function (EVENT_ACTION) {
4
4
  EVENT_ACTION["DOCUMENT_INIT"] = "documentInit";
5
5
  EVENT_ACTION["ADD_STEPS"] = "addSteps";
6
6
  EVENT_ACTION["UPDATE_PARTICIPANTS"] = "updateParticipants";
7
+ EVENT_ACTION["UPDATE_DOCUMENT"] = "updateDocument";
7
8
  EVENT_ACTION["COMMIT_UNCONFIRMED_STEPS"] = "commitUnconfirmedSteps";
8
9
  EVENT_ACTION["REINITIALISE_DOCUMENT"] = "reinitialiseDocument";
9
10
  EVENT_ACTION["ERROR"] = "error";
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "9.17.2";
2
+ export const version = "9.17.3";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -346,10 +346,13 @@ export var DocumentService = /*#__PURE__*/function () {
346
346
  }, reserveCursor ? {
347
347
  reserveCursor: reserveCursor
348
348
  } : {}));
349
+ _this.updateDocumentAnalytics(doc, version);
350
+ });
351
+ _defineProperty(this, "updateDocumentAnalytics", function (doc, version) {
349
352
  var updatedVersion = _this.getCurrentPmVersion();
353
+ var isDocContentValid = _this.validatePMJSONDocument(doc);
350
354
  if (_this.getCurrentPmVersion() !== version) {
351
355
  var _doc$content, _this$analyticsHelper17;
352
- var isDocContentValid = _this.validatePMJSONDocument(doc);
353
356
  var _error = new UpdateDocumentError('Failed to update the document', {
354
357
  newVersion: version,
355
358
  editorVersion: updatedVersion,
@@ -373,14 +376,23 @@ export var DocumentService = /*#__PURE__*/function () {
373
376
  throw _error;
374
377
  }
375
378
  // Otherwise just fail silently for now
379
+ } else {
380
+ var _this$analyticsHelper18, _doc$content2;
381
+ (_this$analyticsHelper18 = _this.analyticsHelper) === null || _this$analyticsHelper18 === void 0 || _this$analyticsHelper18.sendActionEvent(EVENT_ACTION.UPDATE_DOCUMENT, EVENT_STATUS.SUCCESS, {
382
+ newVersion: version,
383
+ editorVersion: updatedVersion,
384
+ isDocTruthy: !!doc,
385
+ docHasContent: (doc === null || doc === void 0 || (_doc$content2 = doc.content) === null || _doc$content2 === void 0 ? void 0 : _doc$content2.length) >= 1,
386
+ isDocContentValid: isDocContentValid
387
+ });
376
388
  }
377
389
  });
378
390
  _defineProperty(this, "validatePMJSONDocument", function (doc) {
379
391
  try {
380
392
  var _this$getState5;
381
393
  if (!((_this$getState5 = _this.getState) !== null && _this$getState5 !== void 0 && _this$getState5.call(_this))) {
382
- var _this$analyticsHelper18;
383
- (_this$analyticsHelper18 = _this.analyticsHelper) === null || _this$analyticsHelper18 === void 0 || _this$analyticsHelper18.sendErrorEvent(new Error('Editor state is undefined'), 'validatePMJSONDocument called without state');
394
+ var _this$analyticsHelper19;
395
+ (_this$analyticsHelper19 = _this.analyticsHelper) === null || _this$analyticsHelper19 === void 0 || _this$analyticsHelper19.sendErrorEvent(new Error('Editor state is undefined'), 'validatePMJSONDocument called without state');
384
396
  }
385
397
  var state = _this.getState();
386
398
  var content = (doc.content || []).map(function (child) {
@@ -403,7 +415,7 @@ export var DocumentService = /*#__PURE__*/function () {
403
415
  * @throws {Error} Couldn't sync the steps after retrying 30 times
404
416
  */
405
417
  _defineProperty(this, "commitUnconfirmedSteps", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
406
- var unconfirmedSteps, _this$getState6, _this$analyticsHelper20, count, unconfirmedTrs, lastTr, isLastTrConfirmed, _this$analyticsHelper19, nextUnconfirmedSteps, nextUnconfirmedTrs, _this$getUnconfirmedS, state, unconfirmedStepsInfoUGCRemoved, _error2, measure, _this$analyticsHelper21, _this$analyticsHelper22, _measure3;
418
+ var unconfirmedSteps, _this$getState6, _this$analyticsHelper21, count, unconfirmedTrs, lastTr, isLastTrConfirmed, _this$analyticsHelper20, nextUnconfirmedSteps, nextUnconfirmedTrs, _this$getUnconfirmedS, state, unconfirmedStepsInfoUGCRemoved, _error2, measure, _this$analyticsHelper22, _this$analyticsHelper23, _measure3;
407
419
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
408
420
  while (1) switch (_context4.prev = _context4.next) {
409
421
  case 0:
@@ -422,7 +434,7 @@ export var DocumentService = /*#__PURE__*/function () {
422
434
  lastTr = unconfirmedTrs === null || unconfirmedTrs === void 0 ? void 0 : unconfirmedTrs[unconfirmedTrs.length - 1];
423
435
  isLastTrConfirmed = false;
424
436
  if (!((_this$getState6 = _this.getState) !== null && _this$getState6 !== void 0 && _this$getState6.call(_this))) {
425
- (_this$analyticsHelper19 = _this.analyticsHelper) === null || _this$analyticsHelper19 === void 0 || _this$analyticsHelper19.sendErrorEvent(new Error('Editor state is undefined'), 'commitUnconfirmedSteps called without state');
437
+ (_this$analyticsHelper20 = _this.analyticsHelper) === null || _this$analyticsHelper20 === void 0 || _this$analyticsHelper20.sendErrorEvent(new Error('Editor state is undefined'), 'commitUnconfirmedSteps called without state');
426
438
  }
427
439
  case 9:
428
440
  if (isLastTrConfirmed) {
@@ -468,7 +480,7 @@ export var DocumentService = /*#__PURE__*/function () {
468
480
  break;
469
481
  case 22:
470
482
  measure = stopMeasure(MEASURE_NAME.COMMIT_UNCONFIRMED_STEPS, _this.analyticsHelper);
471
- (_this$analyticsHelper20 = _this.analyticsHelper) === null || _this$analyticsHelper20 === void 0 || _this$analyticsHelper20.sendActionEvent(EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, EVENT_STATUS.SUCCESS, {
483
+ (_this$analyticsHelper21 = _this.analyticsHelper) === null || _this$analyticsHelper21 === void 0 || _this$analyticsHelper21.sendActionEvent(EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, EVENT_STATUS.SUCCESS, {
472
484
  latency: measure === null || measure === void 0 ? void 0 : measure.duration,
473
485
  // upon success, emit the total number of unconfirmed steps we synced
474
486
  numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length
@@ -480,11 +492,11 @@ export var DocumentService = /*#__PURE__*/function () {
480
492
  _context4.prev = 26;
481
493
  _context4.t0 = _context4["catch"](1);
482
494
  _measure3 = stopMeasure(MEASURE_NAME.COMMIT_UNCONFIRMED_STEPS, _this.analyticsHelper);
483
- (_this$analyticsHelper21 = _this.analyticsHelper) === null || _this$analyticsHelper21 === void 0 || _this$analyticsHelper21.sendActionEvent(EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, EVENT_STATUS.FAILURE, {
495
+ (_this$analyticsHelper22 = _this.analyticsHelper) === null || _this$analyticsHelper22 === void 0 || _this$analyticsHelper22.sendActionEvent(EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS, EVENT_STATUS.FAILURE, {
484
496
  latency: _measure3 === null || _measure3 === void 0 ? void 0 : _measure3.duration,
485
497
  numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length
486
498
  });
487
- (_this$analyticsHelper22 = _this.analyticsHelper) === null || _this$analyticsHelper22 === void 0 || _this$analyticsHelper22.sendErrorEvent(_context4.t0, 'Error while committing unconfirmed steps');
499
+ (_this$analyticsHelper23 = _this.analyticsHelper) === null || _this$analyticsHelper23 === void 0 || _this$analyticsHelper23.sendErrorEvent(_context4.t0, 'Error while committing unconfirmed steps');
488
500
  throw _context4.t0;
489
501
  case 32:
490
502
  case "end":
@@ -493,17 +505,17 @@ export var DocumentService = /*#__PURE__*/function () {
493
505
  }, _callee4, null, [[1, 26]]);
494
506
  })));
495
507
  _defineProperty(this, "onStepRejectedError", function () {
496
- var _this$analyticsHelper23;
508
+ var _this$analyticsHelper24;
497
509
  _this.stepRejectCounter++;
498
510
  logger("Steps rejected (tries=".concat(_this.stepRejectCounter, ")"));
499
- (_this$analyticsHelper23 = _this.analyticsHelper) === null || _this$analyticsHelper23 === void 0 || _this$analyticsHelper23.sendActionEvent(EVENT_ACTION.SEND_STEPS_RETRY, EVENT_STATUS.INFO, {
511
+ (_this$analyticsHelper24 = _this.analyticsHelper) === null || _this$analyticsHelper24 === void 0 || _this$analyticsHelper24.sendActionEvent(EVENT_ACTION.SEND_STEPS_RETRY, EVENT_STATUS.INFO, {
500
512
  count: _this.stepRejectCounter
501
513
  });
502
514
  var maxRetries = _this.aggressiveCatchup ? MAX_STEP_REJECTED_ERROR_AGGRESSIVE : MAX_STEP_REJECTED_ERROR;
503
515
  if (_this.stepRejectCounter >= maxRetries) {
504
- var _this$analyticsHelper24;
516
+ var _this$analyticsHelper25;
505
517
  logger("The steps were rejected too many times (tries=".concat(_this.stepRejectCounter, ", limit=").concat(MAX_STEP_REJECTED_ERROR, "). Trying to catch-up."));
506
- (_this$analyticsHelper24 = _this.analyticsHelper) === null || _this$analyticsHelper24 === void 0 || _this$analyticsHelper24.sendActionEvent(EVENT_ACTION.CATCHUP_AFTER_MAX_SEND_STEPS_RETRY, EVENT_STATUS.INFO);
518
+ (_this$analyticsHelper25 = _this.analyticsHelper) === null || _this$analyticsHelper25 === void 0 || _this$analyticsHelper25.sendActionEvent(EVENT_ACTION.CATCHUP_AFTER_MAX_SEND_STEPS_RETRY, EVENT_STATUS.INFO);
507
519
  _this.throttledCatchup();
508
520
  } else {
509
521
  // If committing steps failed try again automatically in 1s
@@ -577,9 +589,9 @@ export var DocumentService = /*#__PURE__*/function () {
577
589
  }, 100);
578
590
  }
579
591
  } catch (error) {
580
- var _this$analyticsHelper25;
592
+ var _this$analyticsHelper26;
581
593
  logger("Processing steps failed with error: ".concat(error, ". Triggering catch up call."));
582
- (_this$analyticsHelper25 = this.analyticsHelper) === null || _this$analyticsHelper25 === void 0 || _this$analyticsHelper25.sendErrorEvent(error, 'Error while processing steps');
594
+ (_this$analyticsHelper26 = this.analyticsHelper) === null || _this$analyticsHelper26 === void 0 || _this$analyticsHelper26.sendErrorEvent(error, 'Error while processing steps');
583
595
  this.throttledCatchup();
584
596
  }
585
597
  }
@@ -609,8 +621,8 @@ export var DocumentService = /*#__PURE__*/function () {
609
621
  var _this$getState7;
610
622
  var state = (_this$getState7 = this.getState) === null || _this$getState7 === void 0 ? void 0 : _this$getState7.call(this);
611
623
  if (!state) {
612
- var _this$analyticsHelper26;
613
- (_this$analyticsHelper26 = this.analyticsHelper) === null || _this$analyticsHelper26 === void 0 || _this$analyticsHelper26.sendErrorEvent(new Error('Editor state is undefined'), 'sendStepsFromCurrentState called without state');
624
+ var _this$analyticsHelper27;
625
+ (_this$analyticsHelper27 = this.analyticsHelper) === null || _this$analyticsHelper27 === void 0 || _this$analyticsHelper27.sendErrorEvent(new Error('Editor state is undefined'), 'sendStepsFromCurrentState called without state');
614
626
  return;
615
627
  }
616
628
  this.send(null, null, state, sendAnalyticsEvent);
@@ -635,8 +647,8 @@ export var DocumentService = /*#__PURE__*/function () {
635
647
  // to ensure that analytics events with the number of unconfirmed steps is only
636
648
  // sent once on connection (as opposed to on every step)
637
649
  if (sendAnalyticsEvent) {
638
- var _this$analyticsHelper27;
639
- (_this$analyticsHelper27 = this.analyticsHelper) === null || _this$analyticsHelper27 === void 0 || _this$analyticsHelper27.sendActionEvent(EVENT_ACTION.HAS_UNCONFIRMED_STEPS, EVENT_STATUS.INFO, {
650
+ var _this$analyticsHelper28;
651
+ (_this$analyticsHelper28 = this.analyticsHelper) === null || _this$analyticsHelper28 === void 0 || _this$analyticsHelper28.sendActionEvent(EVENT_ACTION.HAS_UNCONFIRMED_STEPS, EVENT_STATUS.INFO, {
640
652
  numUnconfirmedSteps: (unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length) || 0
641
653
  });
642
654
  }
@@ -647,8 +659,8 @@ export var DocumentService = /*#__PURE__*/function () {
647
659
  // This is where we would call the sendStepsQueue instead of throttledCommitStep
648
660
  // Only send 1% of events to avoid useless logging
649
661
  if (Math.random() < 0.01) {
650
- var _this$analyticsHelper28;
651
- (_this$analyticsHelper28 = this.analyticsHelper) === null || _this$analyticsHelper28 === void 0 || _this$analyticsHelper28.sendActionEvent(EVENT_ACTION.SEND_STEPS_QUEUE, EVENT_STATUS.INFO);
662
+ var _this$analyticsHelper29;
663
+ (_this$analyticsHelper29 = this.analyticsHelper) === null || _this$analyticsHelper29 === void 0 || _this$analyticsHelper29.sendActionEvent(EVENT_ACTION.SEND_STEPS_QUEUE, EVENT_STATUS.INFO);
652
664
  }
653
665
  // Avoid reference issues using a
654
666
  // method outside of the provider
@@ -4,6 +4,7 @@ export var EVENT_ACTION = /*#__PURE__*/function (EVENT_ACTION) {
4
4
  EVENT_ACTION["DOCUMENT_INIT"] = "documentInit";
5
5
  EVENT_ACTION["ADD_STEPS"] = "addSteps";
6
6
  EVENT_ACTION["UPDATE_PARTICIPANTS"] = "updateParticipants";
7
+ EVENT_ACTION["UPDATE_DOCUMENT"] = "updateDocument";
7
8
  EVENT_ACTION["COMMIT_UNCONFIRMED_STEPS"] = "commitUnconfirmedSteps";
8
9
  EVENT_ACTION["REINITIALISE_DOCUMENT"] = "reinitialiseDocument";
9
10
  EVENT_ACTION["ERROR"] = "error";
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "9.17.2";
2
+ export var version = "9.17.3";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -65,6 +65,7 @@ export declare class DocumentService {
65
65
  onRestore: ({ doc, version, metadata }: CollabInitPayload) => void;
66
66
  getFinalAcknowledgedState: () => Promise<ResolvedEditorState>;
67
67
  updateDocument: ({ doc, version, metadata, reserveCursor, }: CollabInitPayload) => void;
68
+ private updateDocumentAnalytics;
68
69
  private validatePMJSONDocument;
69
70
  /**
70
71
  * Commit the unconfirmed local steps to the back-end service
@@ -5,6 +5,7 @@ export declare enum EVENT_ACTION {
5
5
  DOCUMENT_INIT = "documentInit",
6
6
  ADD_STEPS = "addSteps",
7
7
  UPDATE_PARTICIPANTS = "updateParticipants",
8
+ UPDATE_DOCUMENT = "updateDocument",
8
9
  COMMIT_UNCONFIRMED_STEPS = "commitUnconfirmedSteps",
9
10
  REINITIALISE_DOCUMENT = "reinitialiseDocument",
10
11
  ERROR = "error",
@@ -261,7 +262,18 @@ type SendStepsQueueAnalyticsEvent = {
261
262
  documentAri?: string;
262
263
  };
263
264
  };
264
- export type ActionAnalyticsEvent = AddStepsSuccessAnalyticsEvent | AddStepsFailureAnalyticsEvent | ReInitDocFailAnalyticsEvent | ReInitDocSuccessAnalyticsEvent | ConnectionSuccessAnalyticsEvent | ConnectionFailureAnalyticsEvent | CatchUpSuccessAnalyticsEvent | CatchUpFailureAnalyticsEvent | DocumentInitSuccessAnalyticsEvent | UpdateParticipantsSuccessAnalyticsEvent | CommitUnconfirmedStepsSuccessAnalyticsEvent | CommitUnconfirmedStepsFailureAnalyticsEvent | PublishPageSuccessAnalyticsEvent | PublishPageFailureAnalyticsEvent | GetCurrentStateSuccessAnalyticsEvent | GetCurrentStateFailureAnalyticsEvent | InvalidateTokenAnalyticsEvent | SendStepsRetryAnalyticsEvent | CatchupAfterMaxSendStepsRetryAnalyticsEvent | CatchUpDroppedStepsEvent | WebsocketMessageVolumeMetricEvent | ProviderInitializedAnalyticsEvent | ProviderSetupAnalyticsEvent | ProviderHasUnconfirmedStepsAnalyticsEvent | SendStepsQueueAnalyticsEvent;
265
+ type UpdateDocumentAnalyticsEvent = {
266
+ eventAction: EVENT_ACTION.UPDATE_DOCUMENT;
267
+ attributes: {
268
+ eventStatus: EVENT_STATUS.SUCCESS;
269
+ newVersion: number;
270
+ editorVersion: number;
271
+ isDocTruthy: boolean;
272
+ docHasContent: boolean;
273
+ isDocContentValid: boolean;
274
+ };
275
+ };
276
+ export type ActionAnalyticsEvent = AddStepsSuccessAnalyticsEvent | AddStepsFailureAnalyticsEvent | ReInitDocFailAnalyticsEvent | ReInitDocSuccessAnalyticsEvent | ConnectionSuccessAnalyticsEvent | ConnectionFailureAnalyticsEvent | CatchUpSuccessAnalyticsEvent | CatchUpFailureAnalyticsEvent | DocumentInitSuccessAnalyticsEvent | UpdateParticipantsSuccessAnalyticsEvent | CommitUnconfirmedStepsSuccessAnalyticsEvent | CommitUnconfirmedStepsFailureAnalyticsEvent | PublishPageSuccessAnalyticsEvent | PublishPageFailureAnalyticsEvent | GetCurrentStateSuccessAnalyticsEvent | GetCurrentStateFailureAnalyticsEvent | InvalidateTokenAnalyticsEvent | SendStepsRetryAnalyticsEvent | CatchupAfterMaxSendStepsRetryAnalyticsEvent | CatchUpDroppedStepsEvent | WebsocketMessageVolumeMetricEvent | ProviderInitializedAnalyticsEvent | ProviderSetupAnalyticsEvent | ProviderHasUnconfirmedStepsAnalyticsEvent | SendStepsQueueAnalyticsEvent | UpdateDocumentAnalyticsEvent;
265
277
  export declare const ACK_MAX_TRY = 60;
266
278
  export declare const CONFLUENCE = "confluence";
267
279
  export {};
@@ -65,6 +65,7 @@ export declare class DocumentService {
65
65
  onRestore: ({ doc, version, metadata }: CollabInitPayload) => void;
66
66
  getFinalAcknowledgedState: () => Promise<ResolvedEditorState>;
67
67
  updateDocument: ({ doc, version, metadata, reserveCursor, }: CollabInitPayload) => void;
68
+ private updateDocumentAnalytics;
68
69
  private validatePMJSONDocument;
69
70
  /**
70
71
  * Commit the unconfirmed local steps to the back-end service
@@ -5,6 +5,7 @@ export declare enum EVENT_ACTION {
5
5
  DOCUMENT_INIT = "documentInit",
6
6
  ADD_STEPS = "addSteps",
7
7
  UPDATE_PARTICIPANTS = "updateParticipants",
8
+ UPDATE_DOCUMENT = "updateDocument",
8
9
  COMMIT_UNCONFIRMED_STEPS = "commitUnconfirmedSteps",
9
10
  REINITIALISE_DOCUMENT = "reinitialiseDocument",
10
11
  ERROR = "error",
@@ -261,7 +262,18 @@ type SendStepsQueueAnalyticsEvent = {
261
262
  documentAri?: string;
262
263
  };
263
264
  };
264
- export type ActionAnalyticsEvent = AddStepsSuccessAnalyticsEvent | AddStepsFailureAnalyticsEvent | ReInitDocFailAnalyticsEvent | ReInitDocSuccessAnalyticsEvent | ConnectionSuccessAnalyticsEvent | ConnectionFailureAnalyticsEvent | CatchUpSuccessAnalyticsEvent | CatchUpFailureAnalyticsEvent | DocumentInitSuccessAnalyticsEvent | UpdateParticipantsSuccessAnalyticsEvent | CommitUnconfirmedStepsSuccessAnalyticsEvent | CommitUnconfirmedStepsFailureAnalyticsEvent | PublishPageSuccessAnalyticsEvent | PublishPageFailureAnalyticsEvent | GetCurrentStateSuccessAnalyticsEvent | GetCurrentStateFailureAnalyticsEvent | InvalidateTokenAnalyticsEvent | SendStepsRetryAnalyticsEvent | CatchupAfterMaxSendStepsRetryAnalyticsEvent | CatchUpDroppedStepsEvent | WebsocketMessageVolumeMetricEvent | ProviderInitializedAnalyticsEvent | ProviderSetupAnalyticsEvent | ProviderHasUnconfirmedStepsAnalyticsEvent | SendStepsQueueAnalyticsEvent;
265
+ type UpdateDocumentAnalyticsEvent = {
266
+ eventAction: EVENT_ACTION.UPDATE_DOCUMENT;
267
+ attributes: {
268
+ eventStatus: EVENT_STATUS.SUCCESS;
269
+ newVersion: number;
270
+ editorVersion: number;
271
+ isDocTruthy: boolean;
272
+ docHasContent: boolean;
273
+ isDocContentValid: boolean;
274
+ };
275
+ };
276
+ export type ActionAnalyticsEvent = AddStepsSuccessAnalyticsEvent | AddStepsFailureAnalyticsEvent | ReInitDocFailAnalyticsEvent | ReInitDocSuccessAnalyticsEvent | ConnectionSuccessAnalyticsEvent | ConnectionFailureAnalyticsEvent | CatchUpSuccessAnalyticsEvent | CatchUpFailureAnalyticsEvent | DocumentInitSuccessAnalyticsEvent | UpdateParticipantsSuccessAnalyticsEvent | CommitUnconfirmedStepsSuccessAnalyticsEvent | CommitUnconfirmedStepsFailureAnalyticsEvent | PublishPageSuccessAnalyticsEvent | PublishPageFailureAnalyticsEvent | GetCurrentStateSuccessAnalyticsEvent | GetCurrentStateFailureAnalyticsEvent | InvalidateTokenAnalyticsEvent | SendStepsRetryAnalyticsEvent | CatchupAfterMaxSendStepsRetryAnalyticsEvent | CatchUpDroppedStepsEvent | WebsocketMessageVolumeMetricEvent | ProviderInitializedAnalyticsEvent | ProviderSetupAnalyticsEvent | ProviderHasUnconfirmedStepsAnalyticsEvent | SendStepsQueueAnalyticsEvent | UpdateDocumentAnalyticsEvent;
265
277
  export declare const ACK_MAX_TRY = 60;
266
278
  export declare const CONFLUENCE = "confluence";
267
279
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "9.17.2",
3
+ "version": "9.17.3",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"