@atlaskit/collab-provider 8.1.0 → 8.2.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/analytics/index.js +2 -11
  3. package/dist/cjs/analytics/performance.js +2 -16
  4. package/dist/cjs/channel.js +63 -114
  5. package/dist/cjs/disconnected-reason-mapper.js +0 -2
  6. package/dist/cjs/emitter.js +3 -11
  7. package/dist/cjs/error-code-mapper.js +4 -17
  8. package/dist/cjs/feature-flags/__test__/index.unit.js +0 -1
  9. package/dist/cjs/feature-flags/index.js +5 -15
  10. package/dist/cjs/feature-flags/types.js +2 -0
  11. package/dist/cjs/helpers/const.js +2 -8
  12. package/dist/cjs/helpers/utils.js +0 -12
  13. package/dist/cjs/index.js +0 -1
  14. package/dist/cjs/provider/catchup.js +38 -42
  15. package/dist/cjs/provider/index.js +150 -281
  16. package/dist/cjs/socket-io-provider.js +2 -12
  17. package/dist/cjs/types.js +0 -1
  18. package/dist/cjs/version-wrapper.js +1 -3
  19. package/dist/cjs/version.json +1 -1
  20. package/dist/es2019/analytics/index.js +2 -3
  21. package/dist/es2019/analytics/performance.js +2 -13
  22. package/dist/es2019/channel.js +54 -64
  23. package/dist/es2019/disconnected-reason-mapper.js +1 -2
  24. package/dist/es2019/emitter.js +3 -8
  25. package/dist/es2019/error-code-mapper.js +4 -12
  26. package/dist/es2019/feature-flags/index.js +2 -5
  27. package/dist/es2019/feature-flags/types.js +2 -0
  28. package/dist/es2019/helpers/const.js +2 -8
  29. package/dist/es2019/helpers/utils.js +0 -2
  30. package/dist/es2019/provider/catchup.js +33 -17
  31. package/dist/es2019/provider/index.js +116 -187
  32. package/dist/es2019/socket-io-provider.js +4 -2
  33. package/dist/es2019/types.js +1 -1
  34. package/dist/es2019/version-wrapper.js +1 -1
  35. package/dist/es2019/version.json +1 -1
  36. package/dist/esm/analytics/index.js +2 -6
  37. package/dist/esm/analytics/performance.js +2 -13
  38. package/dist/esm/channel.js +65 -107
  39. package/dist/esm/disconnected-reason-mapper.js +1 -2
  40. package/dist/esm/emitter.js +3 -6
  41. package/dist/esm/error-code-mapper.js +4 -12
  42. package/dist/esm/feature-flags/index.js +5 -10
  43. package/dist/esm/feature-flags/types.js +2 -0
  44. package/dist/esm/helpers/const.js +2 -8
  45. package/dist/esm/helpers/utils.js +0 -3
  46. package/dist/esm/provider/catchup.js +38 -35
  47. package/dist/esm/provider/index.js +150 -283
  48. package/dist/esm/socket-io-provider.js +2 -5
  49. package/dist/esm/types.js +1 -1
  50. package/dist/esm/version-wrapper.js +1 -1
  51. package/dist/esm/version.json +1 -1
  52. package/dist/types/channel.d.ts +1 -0
  53. package/dist/types/error-code-mapper.d.ts +1 -1
  54. package/dist/types/helpers/const.d.ts +16 -3
  55. package/dist/types/types.d.ts +3 -1
  56. package/package.json +7 -5
  57. package/report.api.md +6 -0
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.errorCodeMapper = exports.ErrorCodeMapper = void 0;
9
-
10
8
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
-
12
9
  var ErrorCodeMapper = {
13
10
  noPermissionError: {
14
11
  code: 'NO_PERMISSION_ERROR',
@@ -36,31 +33,28 @@ var ErrorCodeMapper = {
36
33
  },
37
34
  internalError: {
38
35
  code: 'INTERNAL_SERVICE_ERROR',
39
- message: 'Collab service has return internal server error'
36
+ message: 'Collab service has experienced an internal server error'
40
37
  }
41
38
  };
42
39
  exports.ErrorCodeMapper = ErrorCodeMapper;
43
-
44
40
  var errorCodeMapper = function errorCodeMapper(error) {
45
41
  var _error$data;
46
-
47
42
  switch ((_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.code) {
48
43
  case 'INSUFFICIENT_EDITING_PERMISSION':
49
44
  return {
50
45
  status: 403,
51
46
  code: ErrorCodeMapper.noPermissionError.code,
52
47
  message: ErrorCodeMapper.noPermissionError.message,
53
- reason: // Typescript magic so it detects the union type
48
+ reason:
49
+ // Typescript magic so it detects the union type
54
50
  (0, _typeof2.default)(error.data.meta) === 'object' ? error.data.meta.reason : undefined
55
51
  };
56
-
57
52
  case 'DOCUMENT_NOT_FOUND':
58
53
  return {
59
54
  status: 404,
60
55
  code: ErrorCodeMapper.documentNotFound.code,
61
56
  message: ErrorCodeMapper.documentNotFound.message
62
57
  };
63
-
64
58
  case 'FAILED_ON_S3':
65
59
  case 'DYNAMO_ERROR':
66
60
  return {
@@ -68,19 +62,12 @@ var errorCodeMapper = function errorCodeMapper(error) {
68
62
  code: ErrorCodeMapper.failToSave.code,
69
63
  message: ErrorCodeMapper.failToSave.message
70
64
  };
71
-
72
- case 'CATCHUP_FAILED':
73
- case 'GET_QUERY_TIME_OUT':
74
- case 'INIT_DATA_LOAD_FAILED':
65
+ default:
75
66
  return {
76
67
  status: 500,
77
68
  code: ErrorCodeMapper.internalError.code,
78
69
  message: ErrorCodeMapper.internalError.message
79
70
  };
80
-
81
- default:
82
- break;
83
71
  }
84
72
  };
85
-
86
73
  exports.errorCodeMapper = errorCodeMapper;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _index = require("../index");
4
-
5
4
  describe('Feature flags', function () {
6
5
  it('getProductSpecificFeatureFlags', function () {
7
6
  var result = (0, _index.getProductSpecificFeatureFlags)({
@@ -1,62 +1,52 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.getCollabProviderFeatureFlag = getCollabProviderFeatureFlag;
9
8
  exports.getProductSpecificFeatureFlags = void 0;
10
-
11
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
-
13
10
  var defaultNCSFeatureFlags = {
14
11
  testFF: false
15
12
  };
13
+
16
14
  /**
17
15
  * Note that Confluence should have the same FF sets as NCS
18
16
  */
19
-
20
17
  var productKeys = {
21
18
  confluence: {
22
19
  testFF: 'confluence.fe.collab.provider.testFF'
23
20
  }
24
21
  };
25
-
26
22
  var filterFeatureFlagNames = function filterFeatureFlagNames(flags) {
27
23
  var pairs = Object.entries(flags);
28
24
  return pairs.filter(function (_ref) {
29
25
  var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
30
- _key = _ref2[0],
31
- value = _ref2[1];
32
-
26
+ _key = _ref2[0],
27
+ value = _ref2[1];
33
28
  return !!value;
34
29
  }).map(function (_ref3) {
35
30
  var _ref4 = (0, _slicedToArray2.default)(_ref3, 1),
36
- key = _ref4[0];
37
-
31
+ key = _ref4[0];
38
32
  return key;
39
33
  });
40
34
  };
35
+
41
36
  /**
42
37
  * Takes a record of {NCS Feature Flag Names → boolean} and a supported product name.
43
38
  * Returns the corresponding product’s Launch Darkly Keys for each of the flags set as true in the input record.
44
39
  * */
45
-
46
-
47
40
  var getProductSpecificFeatureFlags = function getProductSpecificFeatureFlags(flags, product) {
48
41
  var ncsFeatureFlags = filterFeatureFlagNames(flags);
49
42
  return ncsFeatureFlags.map(function (key) {
50
43
  return productKeys[product][key];
51
44
  });
52
45
  };
53
-
54
46
  exports.getProductSpecificFeatureFlags = getProductSpecificFeatureFlags;
55
-
56
47
  function getCollabProviderFeatureFlag(flagName, featureFlags) {
57
48
  if (featureFlags) {
58
49
  return flagName in featureFlags ? featureFlags[flagName] : defaultNCSFeatureFlags[flagName];
59
50
  }
60
-
61
51
  return defaultNCSFeatureFlags[flagName];
62
52
  }
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.supportedProducts = void 0;
7
7
  // NCS feature flags - type and defaults defined here in one source of truth
8
+
8
9
  // With this type we ensure the object will contain all the flags
10
+
9
11
  var supportedProducts = ['confluence'];
10
12
  exports.supportedProducts = supportedProducts;
@@ -8,15 +8,12 @@ var EVENT_SUBJECT = 'collab';
8
8
  exports.EVENT_SUBJECT = EVENT_SUBJECT;
9
9
  var COLLAB_SERVICE;
10
10
  exports.COLLAB_SERVICE = COLLAB_SERVICE;
11
-
12
11
  (function (COLLAB_SERVICE) {
13
12
  COLLAB_SERVICE["NCS"] = "ncs";
14
13
  COLLAB_SERVICE["SYNCHRONY"] = "synchrony";
15
14
  })(COLLAB_SERVICE || (exports.COLLAB_SERVICE = COLLAB_SERVICE = {}));
16
-
17
15
  var EVENT_ACTION;
18
16
  exports.EVENT_ACTION = EVENT_ACTION;
19
-
20
17
  (function (EVENT_ACTION) {
21
18
  EVENT_ACTION["CONNECTION"] = "connection";
22
19
  EVENT_ACTION["CATCHUP"] = "catchup";
@@ -26,25 +23,22 @@ exports.EVENT_ACTION = EVENT_ACTION;
26
23
  EVENT_ACTION["UPDATE_PARTICIPANTS"] = "updateParticipants";
27
24
  EVENT_ACTION["COMMIT_UNCONFIRMED_STEPS"] = "commitUnconfirmedSteps";
28
25
  EVENT_ACTION["REINITIALISE_DOCUMENT"] = "reinitialiseDocument";
26
+ EVENT_ACTION["INIT_PROVIDER"] = "initProvider";
27
+ EVENT_ACTION["ERROR"] = "error";
29
28
  })(EVENT_ACTION || (exports.EVENT_ACTION = EVENT_ACTION = {}));
30
-
31
29
  var EVENT_STATUS;
32
30
  exports.EVENT_STATUS = EVENT_STATUS;
33
-
34
31
  (function (EVENT_STATUS) {
35
32
  EVENT_STATUS["SUCCESS"] = "SUCCESS";
36
33
  EVENT_STATUS["FAILURE"] = "FAILURE";
37
34
  })(EVENT_STATUS || (exports.EVENT_STATUS = EVENT_STATUS = {}));
38
-
39
35
  var ADD_STEPS_TYPE;
40
36
  exports.ADD_STEPS_TYPE = ADD_STEPS_TYPE;
41
-
42
37
  (function (ADD_STEPS_TYPE) {
43
38
  ADD_STEPS_TYPE["ACCEPTED"] = "ACCEPTED";
44
39
  ADD_STEPS_TYPE["REJECTED"] = "REJECTED";
45
40
  ADD_STEPS_TYPE["ERROR"] = "ERROR";
46
41
  })(ADD_STEPS_TYPE || (exports.ADD_STEPS_TYPE = ADD_STEPS_TYPE = {}));
47
-
48
42
  var ACK_MAX_TRY = 30;
49
43
  exports.ACK_MAX_TRY = ACK_MAX_TRY;
50
44
  var CONFLUENCE = 'confluence';
@@ -5,22 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getSubProduct = exports.getProduct = exports.getParticipant = exports.createLogger = void 0;
7
7
  exports.sleep = sleep;
8
-
9
8
  var createLogger = function createLogger(prefix) {
10
9
  var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'blue';
11
10
  return function (msg) {
12
11
  var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
13
-
14
12
  if (window.COLLAB_PROVIDER_LOGGER) {
15
13
  // eslint-disable-next-line no-console
16
14
  console.log("%cCollab-".concat(prefix, ": ").concat(msg), "color: ".concat(color, "; font-weight: bold"), data);
17
15
  }
18
16
  };
19
17
  };
20
-
21
18
  exports.createLogger = createLogger;
22
19
  var logger = createLogger('Helper:util', 'black');
23
-
24
20
  var getParticipant = function getParticipant(userId) {
25
21
  logger('getParticipant: ', userId);
26
22
  return {
@@ -30,27 +26,19 @@ var getParticipant = function getParticipant(userId) {
30
26
  email: "".concat(userId.replace(/\s/g, '').toLocaleLowerCase(), "@atlassian.com")
31
27
  };
32
28
  };
33
-
34
29
  exports.getParticipant = getParticipant;
35
-
36
30
  function sleep(ms) {
37
31
  return new Promise(function (resolve) {
38
32
  setTimeout(resolve, ms);
39
33
  });
40
34
  }
41
-
42
35
  var getProduct = function getProduct(productInfo) {
43
36
  var _productInfo$product;
44
-
45
37
  return (_productInfo$product = productInfo === null || productInfo === void 0 ? void 0 : productInfo.product) !== null && _productInfo$product !== void 0 ? _productInfo$product : 'unknown';
46
38
  };
47
-
48
39
  exports.getProduct = getProduct;
49
-
50
40
  var getSubProduct = function getSubProduct(productInfo) {
51
41
  var _productInfo$subProdu;
52
-
53
42
  return (_productInfo$subProdu = productInfo === null || productInfo === void 0 ? void 0 : productInfo.subProduct) !== null && _productInfo$subProdu !== void 0 ? _productInfo$subProdu : !!(productInfo !== null && productInfo !== void 0 && productInfo.product) ? 'none' : 'unknown';
54
43
  };
55
-
56
44
  exports.getSubProduct = getSubProduct;
package/dist/cjs/index.js CHANGED
@@ -9,5 +9,4 @@ Object.defineProperty(exports, "Provider", {
9
9
  return _provider.Provider;
10
10
  }
11
11
  });
12
-
13
12
  var _provider = require("./provider");
@@ -1,45 +1,34 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.catchup = void 0;
9
8
  exports.rebaseSteps = rebaseSteps;
10
-
11
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
12
-
13
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
14
-
15
11
  var _utils = require("../helpers/utils");
16
-
17
12
  var _prosemirrorTransform = require("prosemirror-transform");
18
-
19
13
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
20
-
21
14
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
22
-
23
15
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
24
-
25
16
  var logger = (0, _utils.createLogger)('Catchup', 'red');
17
+
26
18
  /**
27
19
  * Rebase the steps based on the mapping pipeline.
28
20
  * Some steps could be lost, if they are no longer
29
21
  * invalid after rebased.
30
22
  */
31
-
32
23
  function rebaseSteps(steps, mapping) {
33
24
  var newSteps = [];
34
-
35
25
  var _iterator = _createForOfIteratorHelper(steps),
36
- _step;
37
-
26
+ _step;
38
27
  try {
39
28
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
40
29
  var step = _step.value;
41
- var newStep = step.map(mapping); // newStep could be null(means invalid after rebase) when can't rebase.
42
-
30
+ var newStep = step.map(mapping);
31
+ // newStep could be null(means invalid after rebase) when can't rebase.
43
32
  if (newStep) {
44
33
  newSteps.push(newStep);
45
34
  }
@@ -49,88 +38,97 @@ function rebaseSteps(steps, mapping) {
49
38
  } finally {
50
39
  _iterator.f();
51
40
  }
52
-
53
41
  return newSteps;
54
42
  }
55
-
56
43
  var catchup = /*#__PURE__*/function () {
57
44
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(opt) {
58
- var _yield$opt$fetchCatch, doc, serverStepMaps, serverVersion, metadata, currentPmVersion, _ref2, unconfirmedSteps, stepMaps, mapping, newUnconfirmedSteps;
59
-
45
+ var _yield$opt$fetchCatch, doc, serverStepMaps, serverVersion, metadata, currentPmVersion, _ref2, unconfirmedSteps, _ref3, _unconfirmedSteps, stepMaps, mapping, newUnconfirmedSteps;
60
46
  return _regenerator.default.wrap(function _callee$(_context) {
61
47
  while (1) {
62
48
  switch (_context.prev = _context.next) {
63
49
  case 0:
64
50
  _context.next = 2;
65
51
  return opt.fetchCatchup(opt.getCurrentPmVersion());
66
-
67
52
  case 2:
68
53
  _yield$opt$fetchCatch = _context.sent;
69
54
  doc = _yield$opt$fetchCatch.doc;
70
55
  serverStepMaps = _yield$opt$fetchCatch.stepMaps;
71
56
  serverVersion = _yield$opt$fetchCatch.version;
72
57
  metadata = _yield$opt$fetchCatch.metadata;
73
-
74
58
  if (doc) {
75
59
  currentPmVersion = opt.getCurrentPmVersion();
76
-
77
60
  if (typeof serverVersion === 'undefined') {
78
61
  logger("Could not determine server version");
79
62
  } else if (serverVersion <= currentPmVersion) {
80
- logger("Catchup steps we already have. Ignoring.");
63
+ // there are no step maps in this case after page recovery
64
+ _ref2 = opt.getUnconfirmedSteps() || {
65
+ steps: []
66
+ }, unconfirmedSteps = _ref2.steps; // replace the entire document
67
+ logger("Replacing document: ".concat(doc));
68
+ logger("getting metadata: ".concat(metadata));
69
+ // Replace local document and version number
70
+ opt.updateDocumentWithMetadata({
71
+ doc: JSON.parse(doc),
72
+ version: serverVersion,
73
+ metadata: metadata,
74
+ reserveCursor: true
75
+ });
76
+ if (unconfirmedSteps.length) {
77
+ opt.applyLocalSteps(unconfirmedSteps);
78
+ }
81
79
  } else {
82
80
  // Please, do not use those steps inside of async
83
81
  // method. That will lead to outdated steps
84
- _ref2 = opt.getUnconfirmedSteps() || {
82
+ _ref3 = opt.getUnconfirmedSteps() || {
85
83
  steps: []
86
- }, unconfirmedSteps = _ref2.steps;
84
+ }, _unconfirmedSteps = _ref3.steps;
87
85
  logger("Too far behind[current: v".concat(currentPmVersion, ", server: v").concat(serverVersion, ". ").concat(serverStepMaps.length, " steps need to catchup]"));
88
86
  /**
89
87
  * Remove steps from queue where the version is older than
90
88
  * the version we received from service. Keep steps that might be
91
89
  * newer.
92
90
  */
93
-
94
91
  opt.filterQueue(function (data) {
95
92
  return data.version > serverVersion;
96
- }); // We are too far behind - replace the entire document
93
+ });
97
94
 
95
+ // We are too far behind - replace the entire document
98
96
  logger("Replacing document: ".concat(doc));
99
- logger("getting metadata: ".concat(metadata)); // Replace local document and version number
97
+ logger("getting metadata: ".concat(metadata));
100
98
 
99
+ // Replace local document and version number
101
100
  opt.updateDocumentWithMetadata({
102
101
  doc: JSON.parse(doc),
103
102
  version: serverVersion,
104
103
  metadata: metadata,
105
104
  reserveCursor: true
106
- }); // After replacing the whole document in the editor, we need to reapply the unconfirmed
105
+ });
106
+
107
+ // After replacing the whole document in the editor, we need to reapply the unconfirmed
107
108
  // steps back into the editor, so we don't lose any data. But before that, we need to rebase
108
109
  // those steps since their position could be changed after replacing.
109
110
  // https://prosemirror.net/docs/guide/#transform.rebasing
110
-
111
- if (unconfirmedSteps.length) {
111
+ if (_unconfirmedSteps.length) {
112
112
  // Create StepMap from StepMap JSON
113
113
  // eslint-disable-next-line no-unused-vars
114
- stepMaps = serverStepMaps.map(function (_ref3) {
115
- var ranges = _ref3.ranges,
116
- inverted = _ref3.inverted;
114
+ stepMaps = serverStepMaps.map(function (_ref4) {
115
+ var ranges = _ref4.ranges,
116
+ inverted = _ref4.inverted;
117
117
  // Due to @types/prosemirror-transform mismatch with the actual
118
118
  // constructor, hack to set the `inverted`.
119
119
  var stepMap = new _prosemirrorTransform.StepMap(ranges);
120
120
  stepMap.inverted = inverted;
121
121
  return stepMap;
122
122
  }); // create Mappng used for Step.map
123
-
124
123
  mapping = new _prosemirrorTransform.Mapping(stepMaps);
125
- logger("".concat(unconfirmedSteps.length, " unconfirmed steps before rebased: ").concat(JSON.stringify(unconfirmedSteps)));
126
- newUnconfirmedSteps = rebaseSteps(unconfirmedSteps, mapping);
127
- logger("Re-aply ".concat(newUnconfirmedSteps.length, " mapped unconfirmed steps: ").concat(JSON.stringify(newUnconfirmedSteps))); // Re-aply local steps
128
-
124
+ logger("".concat(_unconfirmedSteps.length, " unconfirmed steps before rebased: ").concat(JSON.stringify(_unconfirmedSteps)));
125
+ newUnconfirmedSteps = rebaseSteps(_unconfirmedSteps, mapping);
126
+ logger("Re-aply ".concat(newUnconfirmedSteps.length, " mapped unconfirmed steps: ").concat(JSON.stringify(newUnconfirmedSteps)));
127
+ // Re-aply local steps
129
128
  opt.applyLocalSteps(newUnconfirmedSteps);
130
129
  }
131
130
  }
132
131
  }
133
-
134
132
  case 8:
135
133
  case "end":
136
134
  return _context.stop();
@@ -138,10 +136,8 @@ var catchup = /*#__PURE__*/function () {
138
136
  }
139
137
  }, _callee);
140
138
  }));
141
-
142
139
  return function catchup(_x) {
143
140
  return _ref.apply(this, arguments);
144
141
  };
145
142
  }();
146
-
147
143
  exports.catchup = catchup;