@atlaskit/collab-provider 16.0.1 → 16.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,26 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 16.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`e6fbfbf141ff3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e6fbfbf141ff3) -
8
+ Cleanup feature exp cleanup-platform_editor_send_client_platform_header
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 16.0.2
15
+
16
+ ### Patch Changes
17
+
18
+ - [`224048d036344`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/224048d036344) -
19
+ EDITOR-5683 do not rethrow setMetadataError: Cannot send metadata, currently offline and
20
+ setMetadataError: Cannot send metadata, not initialized yet as they are intermittent connection
21
+ errors
22
+ - Updated dependencies
23
+
3
24
  ## 16.0.1
4
25
 
5
26
  ### Patch Changes
@@ -756,6 +756,11 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
756
756
  } catch (error) {
757
757
  var _this$analyticsHelper13;
758
758
  (_this$analyticsHelper13 = this.analyticsHelper) === null || _this$analyticsHelper13 === void 0 || _this$analyticsHelper13.sendErrorEvent(error, 'Error while setting metadata');
759
+ // Don't re-throw for transient connectivity/initialization errors.
760
+ // (e.g. socket not yet ready, user momentarily offline)
761
+ if ((error instanceof _customErrors.NotInitializedError || error instanceof _customErrors.NotConnectedError) && (0, _expValEquals.expValEquals)('platform_editor_ignore_metadata_connection_errors', 'isEnabled', true)) {
762
+ return;
763
+ }
759
764
  throw new _customErrors.SetMetadataError('Error while setting metadata', error);
760
765
  }
761
766
  }
@@ -44,11 +44,9 @@ function createSocketIOSocket(url, auth, productInfo, isPresenceOnly, analyticsH
44
44
  }
45
45
  var extraHeaders = {
46
46
  'x-product': (0, _utils.getProduct)(productInfo),
47
- 'x-subproduct': (0, _utils.getSubProduct)(productInfo)
47
+ 'x-subproduct': (0, _utils.getSubProduct)(productInfo),
48
+ 'x-client-platform': 'web'
48
49
  };
49
- if ((0, _expValEquals.expValEquals)('platform_editor_send_client_platform_header', 'isEnabled', true, false)) {
50
- extraHeaders['x-client-platform'] = 'web';
51
- }
52
50
  var client = (0, _socket.io)(url, {
53
51
  reconnectionDelayMax: socketIOOptions.RECONNECTION_DELAY_MAX,
54
52
  reconnectionDelay: socketIOOptions.RECONNECTION_DELAY,
@@ -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 = "16.0.0";
8
+ var version = exports.version = "16.0.2";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -8,7 +8,7 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
8
  import { createLogger, logObfuscatedSteps } from '../helpers/utils';
9
9
  import AnalyticsHelper from '../analytics/analytics-helper';
10
10
  import { telepointerCallback } from '../participants/telepointers-helper';
11
- import { CustomError, DestroyError, GetCurrentStateError, GetFinalAcknowledgedStateError, ProviderInitialisationError, SendTransactionError, SetEditorWidthError, SetMetadataError, SetTitleError } from '../errors/custom-errors';
11
+ import { CustomError, DestroyError, GetCurrentStateError, GetFinalAcknowledgedStateError, NotConnectedError, NotInitializedError, ProviderInitialisationError, SendTransactionError, SetEditorWidthError, SetMetadataError, SetTitleError } from '../errors/custom-errors';
12
12
  import { NCS_ERROR_CODE } from '../errors/ncs-errors';
13
13
  import { MetadataService } from '../metadata/metadata-service';
14
14
  import { DocumentService } from '../document/document-service';
@@ -646,6 +646,11 @@ export class Provider extends Emitter {
646
646
  } catch (error) {
647
647
  var _this$analyticsHelper15;
648
648
  (_this$analyticsHelper15 = this.analyticsHelper) === null || _this$analyticsHelper15 === void 0 ? void 0 : _this$analyticsHelper15.sendErrorEvent(error, 'Error while setting metadata');
649
+ // Don't re-throw for transient connectivity/initialization errors.
650
+ // (e.g. socket not yet ready, user momentarily offline)
651
+ if ((error instanceof NotInitializedError || error instanceof NotConnectedError) && expValEquals('platform_editor_ignore_metadata_connection_errors', 'isEnabled', true)) {
652
+ return;
653
+ }
649
654
  throw new SetMetadataError('Error while setting metadata', error);
650
655
  }
651
656
  }
@@ -34,11 +34,9 @@ export function createSocketIOSocket(url, auth, productInfo, isPresenceOnly, ana
34
34
  }
35
35
  const extraHeaders = {
36
36
  'x-product': getProduct(productInfo),
37
- 'x-subproduct': getSubProduct(productInfo)
37
+ 'x-subproduct': getSubProduct(productInfo),
38
+ 'x-client-platform': 'web'
38
39
  };
39
- if (expValEquals('platform_editor_send_client_platform_header', 'isEnabled', true, false)) {
40
- extraHeaders['x-client-platform'] = 'web';
41
- }
42
40
  const client = io(url, {
43
41
  reconnectionDelayMax: socketIOOptions.RECONNECTION_DELAY_MAX,
44
42
  reconnectionDelay: socketIOOptions.RECONNECTION_DELAY,
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "16.0.0";
2
+ export const version = "16.0.2";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -21,7 +21,7 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
21
21
  import { createLogger, logObfuscatedSteps } from '../helpers/utils';
22
22
  import AnalyticsHelper from '../analytics/analytics-helper';
23
23
  import { telepointerCallback } from '../participants/telepointers-helper';
24
- import { CustomError, DestroyError, GetCurrentStateError, GetFinalAcknowledgedStateError, ProviderInitialisationError, SendTransactionError, SetEditorWidthError, SetMetadataError, SetTitleError } from '../errors/custom-errors';
24
+ import { CustomError, DestroyError, GetCurrentStateError, GetFinalAcknowledgedStateError, NotConnectedError, NotInitializedError, ProviderInitialisationError, SendTransactionError, SetEditorWidthError, SetMetadataError, SetTitleError } from '../errors/custom-errors';
25
25
  import { NCS_ERROR_CODE } from '../errors/ncs-errors';
26
26
  import { MetadataService } from '../metadata/metadata-service';
27
27
  import { DocumentService } from '../document/document-service';
@@ -750,6 +750,11 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
750
750
  } catch (error) {
751
751
  var _this$analyticsHelper13;
752
752
  (_this$analyticsHelper13 = this.analyticsHelper) === null || _this$analyticsHelper13 === void 0 || _this$analyticsHelper13.sendErrorEvent(error, 'Error while setting metadata');
753
+ // Don't re-throw for transient connectivity/initialization errors.
754
+ // (e.g. socket not yet ready, user momentarily offline)
755
+ if ((error instanceof NotInitializedError || error instanceof NotConnectedError) && expValEquals('platform_editor_ignore_metadata_connection_errors', 'isEnabled', true)) {
756
+ return;
757
+ }
753
758
  throw new SetMetadataError('Error while setting metadata', error);
754
759
  }
755
760
  }
@@ -36,11 +36,9 @@ export function createSocketIOSocket(url, auth, productInfo, isPresenceOnly, ana
36
36
  }
37
37
  var extraHeaders = {
38
38
  'x-product': getProduct(productInfo),
39
- 'x-subproduct': getSubProduct(productInfo)
39
+ 'x-subproduct': getSubProduct(productInfo),
40
+ 'x-client-platform': 'web'
40
41
  };
41
- if (expValEquals('platform_editor_send_client_platform_header', 'isEnabled', true, false)) {
42
- extraHeaders['x-client-platform'] = 'web';
43
- }
44
42
  var client = io(url, {
45
43
  reconnectionDelayMax: socketIOOptions.RECONNECTION_DELAY_MAX,
46
44
  reconnectionDelay: socketIOOptions.RECONNECTION_DELAY,
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "16.0.0";
2
+ export var version = "16.0.2";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "16.0.1",
3
+ "version": "16.1.0",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/platform-feature-flags": "^1.1.0",
38
38
  "@atlaskit/prosemirror-collab": "^0.22.0",
39
39
  "@atlaskit/react-ufo": "^5.4.0",
40
- "@atlaskit/tmp-editor-statsig": "^36.0.0",
40
+ "@atlaskit/tmp-editor-statsig": "^37.0.0",
41
41
  "@atlaskit/ufo": "^0.4.0",
42
42
  "@atlaskit/util-service-support": "^6.3.0",
43
43
  "@babel/runtime": "^7.0.0",
@@ -73,6 +73,6 @@
73
73
  }
74
74
  },
75
75
  "peerDependencies": {
76
- "@atlaskit/editor-common": "^112.0.0"
76
+ "@atlaskit/editor-common": "^112.2.0"
77
77
  }
78
78
  }