@atlaskit/collab-provider 15.0.2 → 15.1.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 15.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`7726e6522167d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7726e6522167d) -
8
+ Implemented a bypass for the grace period to allow reconnection when the catchup call is skipped
9
+ following a socket disconnect in the collab-provider.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 15.0.3
16
+
17
+ ### Patch Changes
18
+
19
+ - [`64f80db3e663a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/64f80db3e663a) -
20
+ Add @atlassian/a11y-jest-testing to devDependencies.
21
+ - Updated dependencies
22
+
3
23
  ## 15.0.2
4
24
 
5
25
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../../../tsconfig.entry-points.jira.json",
2
+ "extends": "../../../../tsconfig.local-consumption.json",
3
3
  "compilerOptions": {
4
4
  "declaration": true,
5
5
  "target": "es5",
@@ -17,6 +17,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
17
17
  var _uuid = require("uuid");
18
18
  var _emitter = require("../emitter");
19
19
  var _channel = require("../channel");
20
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
20
21
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
21
22
  var _utils = require("../helpers/utils");
22
23
  var _analyticsHelper = _interopRequireDefault(require("../analytics/analytics-helper"));
@@ -143,9 +144,10 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
143
144
  });
144
145
  }
145
146
  // If already initialized, `connected` means reconnected
146
- if (initialized && _this.disconnectedAt &&
147
+ var shouldBypassOutOfSyncGracePeriod = (0, _expValEquals.expValEquals)('collab_bypass_out_of_sync_period_experiment', 'isEnabled', true, false);
148
+ if (initialized && _this.disconnectedAt && (
147
149
  // Offline longer than `OUT_OF_SYNC_PERIOD`
148
- Date.now() - _this.disconnectedAt >= OUT_OF_SYNC_PERIOD) {
150
+ shouldBypassOutOfSyncGracePeriod || Date.now() - _this.disconnectedAt >= OUT_OF_SYNC_PERIOD)) {
149
151
  _this.documentService.throttledCatchupv2(_const.CatchupEventReason.RECONNECTED, {
150
152
  disconnectionPeriodSeconds: Math.floor((Date.now() - _this.disconnectedAt) / 1000),
151
153
  offlineStepsLength: (0, _experiments.editorExperiment)('platform_editor_offline_editing_web', true) ? (0, _getOfflineStepsLength.getOfflineStepsLength)(_this.documentService.getUnconfirmedSteps(), _this.documentService.getUnconfirmedStepsOrigins()) : undefined,
@@ -449,7 +451,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
449
451
  key: "setup",
450
452
  value: function setup(_ref9) {
451
453
  var getState = _ref9.getState,
452
- editorApi = _ref9.editorApi,
454
+ _editorApi = _ref9._editorApi,
453
455
  onSyncUpError = _ref9.onSyncUpError;
454
456
  this.checkForCookies();
455
457
  try {
@@ -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 = "0.0.0-development";
8
+ var version = exports.version = "15.0.3";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -3,6 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import { v4 as uuidv4 } from 'uuid';
4
4
  import { Emitter } from '../emitter';
5
5
  import { Channel } from '../channel';
6
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
8
  import { createLogger, logObfuscatedSteps } from '../helpers/utils';
8
9
  import AnalyticsHelper from '../analytics/analytics-helper';
@@ -123,9 +124,10 @@ export class Provider extends Emitter {
123
124
  });
124
125
  }
125
126
  // If already initialized, `connected` means reconnected
126
- if (initialized && this.disconnectedAt &&
127
+ const shouldBypassOutOfSyncGracePeriod = expValEquals('collab_bypass_out_of_sync_period_experiment', 'isEnabled', true, false);
128
+ if (initialized && this.disconnectedAt && (
127
129
  // Offline longer than `OUT_OF_SYNC_PERIOD`
128
- Date.now() - this.disconnectedAt >= OUT_OF_SYNC_PERIOD) {
130
+ shouldBypassOutOfSyncGracePeriod || Date.now() - this.disconnectedAt >= OUT_OF_SYNC_PERIOD)) {
129
131
  this.documentService.throttledCatchupv2(CatchupEventReason.RECONNECTED, {
130
132
  disconnectionPeriodSeconds: Math.floor((Date.now() - this.disconnectedAt) / 1000),
131
133
  offlineStepsLength: editorExperiment('platform_editor_offline_editing_web', true) ? getOfflineStepsLength(this.documentService.getUnconfirmedSteps(), this.documentService.getUnconfirmedStepsOrigins()) : undefined,
@@ -357,7 +359,8 @@ export class Provider extends Emitter {
357
359
  */
358
360
  setup({
359
361
  getState,
360
- editorApi,
362
+ _editorApi,
363
+ // eslint says unused vars should start with _
361
364
  onSyncUpError
362
365
  }) {
363
366
  this.checkForCookies();
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "0.0.0-development";
2
+ export const version = "15.0.3";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -16,6 +16,7 @@ function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prot
16
16
  import { v4 as uuidv4 } from 'uuid';
17
17
  import { Emitter } from '../emitter';
18
18
  import { Channel } from '../channel';
19
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
19
20
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
20
21
  import { createLogger, logObfuscatedSteps } from '../helpers/utils';
21
22
  import AnalyticsHelper from '../analytics/analytics-helper';
@@ -137,9 +138,10 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
137
138
  });
138
139
  }
139
140
  // If already initialized, `connected` means reconnected
140
- if (initialized && _this.disconnectedAt &&
141
+ var shouldBypassOutOfSyncGracePeriod = expValEquals('collab_bypass_out_of_sync_period_experiment', 'isEnabled', true, false);
142
+ if (initialized && _this.disconnectedAt && (
141
143
  // Offline longer than `OUT_OF_SYNC_PERIOD`
142
- Date.now() - _this.disconnectedAt >= OUT_OF_SYNC_PERIOD) {
144
+ shouldBypassOutOfSyncGracePeriod || Date.now() - _this.disconnectedAt >= OUT_OF_SYNC_PERIOD)) {
143
145
  _this.documentService.throttledCatchupv2(CatchupEventReason.RECONNECTED, {
144
146
  disconnectionPeriodSeconds: Math.floor((Date.now() - _this.disconnectedAt) / 1000),
145
147
  offlineStepsLength: editorExperiment('platform_editor_offline_editing_web', true) ? getOfflineStepsLength(_this.documentService.getUnconfirmedSteps(), _this.documentService.getUnconfirmedStepsOrigins()) : undefined,
@@ -443,7 +445,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
443
445
  key: "setup",
444
446
  value: function setup(_ref9) {
445
447
  var getState = _ref9.getState,
446
- editorApi = _ref9.editorApi,
448
+ _editorApi = _ref9._editorApi,
447
449
  onSyncUpError = _ref9.onSyncUpError;
448
450
  this.checkForCookies();
449
451
  try {
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "0.0.0-development";
2
+ export var version = "15.0.3";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -66,8 +66,9 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
66
66
  * @param {SyncUpErrorFunction} options.onSyncUpError (Optional) Function that gets called when the sync of steps fails after retrying 30 times, used by Editor to log to analytics
67
67
  * @throws {ProviderInitialisationError} Something went wrong during provider initialisation
68
68
  */
69
- setup({ getState, editorApi, onSyncUpError, }: {
70
- editorApi?: any;
69
+ setup({ getState, _editorApi, // eslint says unused vars should start with _
70
+ onSyncUpError, }: {
71
+ _editorApi?: any;
71
72
  getState: () => EditorState;
72
73
  onSyncUpError?: SyncUpErrorFunction;
73
74
  }): this;
@@ -66,8 +66,9 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
66
66
  * @param {SyncUpErrorFunction} options.onSyncUpError (Optional) Function that gets called when the sync of steps fails after retrying 30 times, used by Editor to log to analytics
67
67
  * @throws {ProviderInitialisationError} Something went wrong during provider initialisation
68
68
  */
69
- setup({ getState, editorApi, onSyncUpError, }: {
70
- editorApi?: any;
69
+ setup({ getState, _editorApi, // eslint says unused vars should start with _
70
+ onSyncUpError, }: {
71
+ _editorApi?: any;
71
72
  getState: () => EditorState;
72
73
  onSyncUpError?: SyncUpErrorFunction;
73
74
  }): this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "15.0.2",
3
+ "version": "15.1.0",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -26,9 +26,9 @@
26
26
  "team": "Editor: Collaboration"
27
27
  },
28
28
  "dependencies": {
29
- "@atlaskit/adf-utils": "^19.26.0",
29
+ "@atlaskit/adf-utils": "^19.27.0",
30
30
  "@atlaskit/analytics-gas-types": "^5.1.0",
31
- "@atlaskit/analytics-listeners": "^9.2.0",
31
+ "@atlaskit/analytics-listeners": "^9.3.0",
32
32
  "@atlaskit/anonymous-assets": "^0.0.17",
33
33
  "@atlaskit/atlassian-context": "^0.6.0",
34
34
  "@atlaskit/editor-json-transformer": "^8.31.0",
@@ -37,14 +37,14 @@
37
37
  "@atlaskit/platform-feature-flags": "^1.1.0",
38
38
  "@atlaskit/prosemirror-collab": "^0.22.0",
39
39
  "@atlaskit/react-ufo": "^5.0.0",
40
- "@atlaskit/tmp-editor-statsig": "^16.26.0",
40
+ "@atlaskit/tmp-editor-statsig": "^16.36.0",
41
41
  "@atlaskit/ufo": "^0.4.0",
42
42
  "@atlaskit/util-service-support": "^6.3.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "bind-event-listener": "^3.0.0",
45
45
  "eventemitter2": "^4.1.0",
46
46
  "lodash": "^4.17.21",
47
- "prosemirror-changeset": "^2.2.1",
47
+ "prosemirror-changeset": "^2.3.1",
48
48
  "socket.io-client": "^4.7.5",
49
49
  "uuid": "^3.1.0"
50
50
  },
@@ -64,6 +64,7 @@
64
64
  },
65
65
  "devDependencies": {
66
66
  "@atlaskit/adf-schema": "^51.5.0",
67
+ "@atlassian/a11y-jest-testing": "^0.8.0",
67
68
  "@atlassian/feature-flags-test-utils": "^1.0.0"
68
69
  },
69
70
  "platform-feature-flags": {
@@ -75,6 +76,6 @@
75
76
  }
76
77
  },
77
78
  "peerDependencies": {
78
- "@atlaskit/editor-common": "^111.8.0"
79
+ "@atlaskit/editor-common": "^111.9.0"
79
80
  }
80
81
  }