@atlaskit/collab-provider 9.6.2 → 9.6.4

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,17 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 9.6.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b7cd15f159b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b7cd15f159b) - ESS-3572 Fix getFinalAcknowledgedState and getCurrentState error handlers not catching errors. Add logs to track the title metadata property
8
+
9
+ ## 9.6.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`857daf603b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/857daf603b0) - ESS-3718: change CollabEventPresenceData joined type to ProviderParticipant
14
+
3
15
  ## 9.6.2
4
16
 
5
17
  ### Patch Changes
@@ -144,19 +144,20 @@ var Channel = /*#__PURE__*/function (_Emitter) {
144
144
  logger('Session ID is', _this.socket.id);
145
145
  if (data.type === 'initial') {
146
146
  if (!_this.initialized) {
147
- var _this$initExperience, _this$analyticsHelper6;
147
+ var _this$initExperience, _this$analyticsHelper6, _data$metadata;
148
+ var doc = data.doc,
149
+ version = data.version,
150
+ userId = data.userId,
151
+ metadata = data.metadata;
148
152
  var measure = (0, _performance.stopMeasure)(_performance.MEASURE_NAME.DOCUMENT_INIT, _this.analyticsHelper);
149
153
  (_this$initExperience = _this.initExperience) === null || _this$initExperience === void 0 ? void 0 : _this$initExperience.success();
150
154
  (_this$analyticsHelper6 = _this.analyticsHelper) === null || _this$analyticsHelper6 === void 0 ? void 0 : _this$analyticsHelper6.sendActionEvent(_const.EVENT_ACTION.DOCUMENT_INIT,
151
155
  // TODO: detect when document init fails and fire corresponding event for it
152
156
  _const.EVENT_STATUS.SUCCESS, {
153
157
  latency: measure === null || measure === void 0 ? void 0 : measure.duration,
154
- resetReason: data === null || data === void 0 ? void 0 : data.resetReason
158
+ resetReason: data.resetReason,
159
+ hasTitle: !!((_data$metadata = data.metadata) !== null && _data$metadata !== void 0 && _data$metadata.title)
155
160
  });
156
- var doc = data.doc,
157
- version = data.version,
158
- userId = data.userId,
159
- metadata = data.metadata;
160
161
  _this.initialized = true;
161
162
  _this.emit('init', {
162
163
  doc: doc,
@@ -263,7 +263,8 @@ var DocumentService = /*#__PURE__*/function () {
263
263
  _this.applyLocalSteps(unconfirmedSteps);
264
264
  }
265
265
  (_this$analyticsHelper11 = _this.analyticsHelper) === null || _this$analyticsHelper11 === void 0 ? void 0 : _this$analyticsHelper11.sendActionEvent(_const.EVENT_ACTION.REINITIALISE_DOCUMENT, _const.EVENT_STATUS.SUCCESS, {
266
- numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length
266
+ numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length,
267
+ hasTitle: !!(metadata !== null && metadata !== void 0 && metadata.title)
267
268
  });
268
269
  } catch (restoreError) {
269
270
  var _this$analyticsHelper12, _this$analyticsHelper13;
@@ -192,17 +192,20 @@ var Provider = /*#__PURE__*/function (_Emitter) {
192
192
  while (1) switch (_context.prev = _context.next) {
193
193
  case 0:
194
194
  _context.prev = 0;
195
- return _context.abrupt("return", _this.documentService.getCurrentState());
196
- case 4:
197
- _context.prev = 4;
195
+ _context.next = 3;
196
+ return _this.documentService.getCurrentState();
197
+ case 3:
198
+ return _context.abrupt("return", _context.sent);
199
+ case 6:
200
+ _context.prev = 6;
198
201
  _context.t0 = _context["catch"](0);
199
202
  (_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 ? void 0 : _this$analyticsHelper5.sendErrorEvent(_context.t0, 'Error while returning ADF version of current draft document');
200
203
  throw new _errorTypes.GetCurrentStateError('Error while returning the current state of the draft document', _context.t0);
201
- case 8:
204
+ case 10:
202
205
  case "end":
203
206
  return _context.stop();
204
207
  }
205
- }, _callee, null, [[0, 4]]);
208
+ }, _callee, null, [[0, 6]]);
206
209
  })));
207
210
  /**
208
211
  * Return the final acknowledged (by NCS) ADF version of the current draft document, together with it's title and the current step version.
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/collab-provider";
8
8
  exports.name = name;
9
- var version = "9.6.2";
9
+ var version = "9.6.4";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "9.6.2",
3
+ "version": "9.6.4",
4
4
  "sideEffects": false
5
5
  }
@@ -112,21 +112,22 @@ export class Channel extends Emitter {
112
112
  logger('Session ID is', this.socket.id);
113
113
  if (data.type === 'initial') {
114
114
  if (!this.initialized) {
115
- var _this$initExperience, _this$analyticsHelper6;
115
+ var _this$initExperience, _this$analyticsHelper6, _data$metadata;
116
+ const {
117
+ doc,
118
+ version,
119
+ userId,
120
+ metadata
121
+ } = data;
116
122
  const measure = stopMeasure(MEASURE_NAME.DOCUMENT_INIT, this.analyticsHelper);
117
123
  (_this$initExperience = this.initExperience) === null || _this$initExperience === void 0 ? void 0 : _this$initExperience.success();
118
124
  (_this$analyticsHelper6 = this.analyticsHelper) === null || _this$analyticsHelper6 === void 0 ? void 0 : _this$analyticsHelper6.sendActionEvent(EVENT_ACTION.DOCUMENT_INIT,
119
125
  // TODO: detect when document init fails and fire corresponding event for it
120
126
  EVENT_STATUS.SUCCESS, {
121
127
  latency: measure === null || measure === void 0 ? void 0 : measure.duration,
122
- resetReason: data === null || data === void 0 ? void 0 : data.resetReason
128
+ resetReason: data.resetReason,
129
+ hasTitle: !!((_data$metadata = data.metadata) !== null && _data$metadata !== void 0 && _data$metadata.title)
123
130
  });
124
- const {
125
- doc,
126
- version,
127
- userId,
128
- metadata
129
- } = data;
130
131
  this.initialized = true;
131
132
  this.emit('init', {
132
133
  doc,
@@ -220,7 +220,8 @@ export class DocumentService {
220
220
  this.applyLocalSteps(unconfirmedSteps);
221
221
  }
222
222
  (_this$analyticsHelper11 = this.analyticsHelper) === null || _this$analyticsHelper11 === void 0 ? void 0 : _this$analyticsHelper11.sendActionEvent(EVENT_ACTION.REINITIALISE_DOCUMENT, EVENT_STATUS.SUCCESS, {
223
- numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length
223
+ numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length,
224
+ hasTitle: !!(metadata !== null && metadata !== void 0 && metadata.title)
224
225
  });
225
226
  } catch (restoreError) {
226
227
  var _this$analyticsHelper12, _this$analyticsHelper13;
@@ -165,7 +165,7 @@ export class Provider extends Emitter {
165
165
  */
166
166
  _defineProperty(this, "getCurrentState", async () => {
167
167
  try {
168
- return this.documentService.getCurrentState();
168
+ return await this.documentService.getCurrentState();
169
169
  } catch (error) {
170
170
  var _this$analyticsHelper5;
171
171
  (_this$analyticsHelper5 = this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 ? void 0 : _this$analyticsHelper5.sendErrorEvent(error, 'Error while returning ADF version of current draft document');
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "9.6.2";
2
+ export const version = "9.6.4";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "9.6.2",
3
+ "version": "9.6.4",
4
4
  "sideEffects": false
5
5
  }
@@ -137,19 +137,20 @@ export var Channel = /*#__PURE__*/function (_Emitter) {
137
137
  logger('Session ID is', _this.socket.id);
138
138
  if (data.type === 'initial') {
139
139
  if (!_this.initialized) {
140
- var _this$initExperience, _this$analyticsHelper6;
140
+ var _this$initExperience, _this$analyticsHelper6, _data$metadata;
141
+ var doc = data.doc,
142
+ version = data.version,
143
+ userId = data.userId,
144
+ metadata = data.metadata;
141
145
  var measure = stopMeasure(MEASURE_NAME.DOCUMENT_INIT, _this.analyticsHelper);
142
146
  (_this$initExperience = _this.initExperience) === null || _this$initExperience === void 0 ? void 0 : _this$initExperience.success();
143
147
  (_this$analyticsHelper6 = _this.analyticsHelper) === null || _this$analyticsHelper6 === void 0 ? void 0 : _this$analyticsHelper6.sendActionEvent(EVENT_ACTION.DOCUMENT_INIT,
144
148
  // TODO: detect when document init fails and fire corresponding event for it
145
149
  EVENT_STATUS.SUCCESS, {
146
150
  latency: measure === null || measure === void 0 ? void 0 : measure.duration,
147
- resetReason: data === null || data === void 0 ? void 0 : data.resetReason
151
+ resetReason: data.resetReason,
152
+ hasTitle: !!((_data$metadata = data.metadata) !== null && _data$metadata !== void 0 && _data$metadata.title)
148
153
  });
149
- var doc = data.doc,
150
- version = data.version,
151
- userId = data.userId,
152
- metadata = data.metadata;
153
154
  _this.initialized = true;
154
155
  _this.emit('init', {
155
156
  doc: doc,
@@ -256,7 +256,8 @@ export var DocumentService = /*#__PURE__*/function () {
256
256
  _this.applyLocalSteps(unconfirmedSteps);
257
257
  }
258
258
  (_this$analyticsHelper11 = _this.analyticsHelper) === null || _this$analyticsHelper11 === void 0 ? void 0 : _this$analyticsHelper11.sendActionEvent(EVENT_ACTION.REINITIALISE_DOCUMENT, EVENT_STATUS.SUCCESS, {
259
- numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length
259
+ numUnconfirmedSteps: unconfirmedSteps === null || unconfirmedSteps === void 0 ? void 0 : unconfirmedSteps.length,
260
+ hasTitle: !!(metadata !== null && metadata !== void 0 && metadata.title)
260
261
  });
261
262
  } catch (restoreError) {
262
263
  var _this$analyticsHelper12, _this$analyticsHelper13;
@@ -184,17 +184,20 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
184
184
  while (1) switch (_context.prev = _context.next) {
185
185
  case 0:
186
186
  _context.prev = 0;
187
- return _context.abrupt("return", _this.documentService.getCurrentState());
188
- case 4:
189
- _context.prev = 4;
187
+ _context.next = 3;
188
+ return _this.documentService.getCurrentState();
189
+ case 3:
190
+ return _context.abrupt("return", _context.sent);
191
+ case 6:
192
+ _context.prev = 6;
190
193
  _context.t0 = _context["catch"](0);
191
194
  (_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 ? void 0 : _this$analyticsHelper5.sendErrorEvent(_context.t0, 'Error while returning ADF version of current draft document');
192
195
  throw new GetCurrentStateError('Error while returning the current state of the draft document', _context.t0);
193
- case 8:
196
+ case 10:
194
197
  case "end":
195
198
  return _context.stop();
196
199
  }
197
- }, _callee, null, [[0, 4]]);
200
+ }, _callee, null, [[0, 6]]);
198
201
  })));
199
202
  /**
200
203
  * Return the final acknowledged (by NCS) ADF version of the current draft document, together with it's title and the current step version.
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "9.6.2";
2
+ export var version = "9.6.4";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "9.6.2",
3
+ "version": "9.6.4",
4
4
  "sideEffects": false
5
5
  }
@@ -139,6 +139,7 @@ type DocumentInitSuccessAnalyticsEvent = {
139
139
  eventStatus: EVENT_STATUS.SUCCESS;
140
140
  latency?: number;
141
141
  resetReason?: string;
142
+ hasTitle: boolean;
142
143
  };
143
144
  };
144
145
  type UpdateParticipantsSuccessAnalyticsEvent = {
@@ -8,7 +8,8 @@ import type { ProviderError } from './errors/error-types';
8
8
  import { JSONDocNode } from '@atlaskit/editor-json-transformer';
9
9
  import { GetUserType } from './participants/participants-helper';
10
10
  import AnalyticsHelper from './analytics/analytics-helper';
11
- export type { ProviderParticipant } from './participants/participants-helper';
11
+ import type { ProviderParticipant } from './participants/participants-helper';
12
+ export { ProviderParticipant };
12
13
  export interface CollabParticipant {
13
14
  lastActive: number;
14
15
  sessionId: string;
@@ -40,7 +41,7 @@ export interface CollabEventDisconnectedData {
40
41
  reason: 'CLIENT_DISCONNECT' | 'SERVER_DISCONNECT' | 'SOCKET_CLOSED' | 'SOCKET_ERROR' | 'SOCKET_TIMEOUT' | 'UNKNOWN_DISCONNECT';
41
42
  }
42
43
  export interface CollabEventPresenceData {
43
- joined?: CollabParticipant[];
44
+ joined?: ProviderParticipant[];
44
45
  left?: {
45
46
  sessionId: string;
46
47
  }[];
@@ -139,6 +139,7 @@ type DocumentInitSuccessAnalyticsEvent = {
139
139
  eventStatus: EVENT_STATUS.SUCCESS;
140
140
  latency?: number;
141
141
  resetReason?: string;
142
+ hasTitle: boolean;
142
143
  };
143
144
  };
144
145
  type UpdateParticipantsSuccessAnalyticsEvent = {
@@ -8,7 +8,8 @@ import type { ProviderError } from './errors/error-types';
8
8
  import { JSONDocNode } from '@atlaskit/editor-json-transformer';
9
9
  import { GetUserType } from './participants/participants-helper';
10
10
  import AnalyticsHelper from './analytics/analytics-helper';
11
- export type { ProviderParticipant } from './participants/participants-helper';
11
+ import type { ProviderParticipant } from './participants/participants-helper';
12
+ export { ProviderParticipant };
12
13
  export interface CollabParticipant {
13
14
  lastActive: number;
14
15
  sessionId: string;
@@ -40,7 +41,7 @@ export interface CollabEventDisconnectedData {
40
41
  reason: 'CLIENT_DISCONNECT' | 'SERVER_DISCONNECT' | 'SOCKET_CLOSED' | 'SOCKET_ERROR' | 'SOCKET_TIMEOUT' | 'UNKNOWN_DISCONNECT';
41
42
  }
42
43
  export interface CollabEventPresenceData {
43
- joined?: CollabParticipant[];
44
+ joined?: ProviderParticipant[];
44
45
  left?: {
45
46
  sessionId: string;
46
47
  }[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "9.6.2",
3
+ "version": "9.6.4",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -61,7 +61,7 @@
61
61
  }
62
62
  },
63
63
  "devDependencies": {
64
- "@atlaskit/adf-schema": "^26.1.0",
64
+ "@atlaskit/adf-schema": "^26.2.0",
65
65
  "@atlaskit/analytics-listeners": "^8.7.0",
66
66
  "@atlaskit/editor-test-helpers": "^18.10.0",
67
67
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
package/report.api.md CHANGED
@@ -141,7 +141,7 @@ export interface CollabEventLocalStepData {
141
141
  // @public (undocumented)
142
142
  export interface CollabEventPresenceData {
143
143
  // (undocumented)
144
- joined?: CollabParticipant[];
144
+ joined?: ProviderParticipant[];
145
145
  // (undocumented)
146
146
  left?: {
147
147
  sessionId: string;
@@ -117,7 +117,7 @@ export interface CollabEventLocalStepData {
117
117
  // @public (undocumented)
118
118
  export interface CollabEventPresenceData {
119
119
  // (undocumented)
120
- joined?: CollabParticipant[];
120
+ joined?: ProviderParticipant[];
121
121
  // (undocumented)
122
122
  left?: {
123
123
  sessionId: string;