@wireapp/core 46.40.0 → 46.40.7

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/lib/Account.js CHANGED
@@ -592,7 +592,7 @@ class Account extends commons_1.TypedEventEmitter {
592
592
  try {
593
593
  const start = Date.now();
594
594
  const notificationTime = this.getNotificationEventTime(notification.payload[0]);
595
- this.logger.info(`Processing legacy notifwication "${notification.id}" at ${notificationTime}`, {
595
+ this.logger.info(`Processing legacy notification "${notification.id}" at ${notificationTime}`, {
596
596
  notification,
597
597
  });
598
598
  this.logger.info(`Total notifications queue length: ${this.notificationProcessingQueue.getLength()}`);
@@ -1 +1 @@
1
- {"version":3,"file":"SubconversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/SubconversationService/SubconversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,kBAAkB,EAAkB,MAAM,sCAAsC,CAAC;AACzF,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAGzD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAa,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAI/D,OAAO,EAAC,UAAU,EAAmB,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAGlD,KAAK,MAAM,GAAG;IACZ,wBAAwB,EAAE;QAAC,cAAc,EAAE,WAAW,CAAA;KAAC,CAAC;CACzD,CAAC;AAEF,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;CACrB;AAID,qBAAa,sBAAuB,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IAIjE,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA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C,GACpD,OAAO,CAAC,IAAI,CAAC;YAgCF,mCAAmC;YAMnC,4BAA4B;YAI5B,+BAA+B;YAO/B,8BAA8B;IAwBrC,yBAAyB,yBACR,WAAW,qBACd,kBAAkB,KACpC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO5B;IAEK,iCAAiC,sBACnB,kBAAkB,KACpC,OAAO,CACR;QACE,oBAAoB,EAAE,WAAW,CAAC;QAClC,iBAAiB,EAAE,kBAAkB,CAAC;QACtC,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CACJ,CAOC;IAEK,0BAA0B,yBACT,WAAW,qBACd,kBAAkB,WAC5B,MAAM,qBAOf;IAEK,2BAA2B,yBACV,WAAW,qBACd,kBAAkB,mBAMrC;CACH"}
1
+ {"version":3,"file":"SubconversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/SubconversationService/SubconversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,kBAAkB,EAAkB,MAAM,sCAAsC,CAAC;AACzF,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAGzD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAa,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAI/D,OAAO,EAAC,UAAU,EAAmB,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAGlD,KAAK,MAAM,GAAG;IACZ,wBAAwB,EAAE;QAAC,cAAc,EAAE,WAAW,CAAA;KAAC,CAAC;CACzD,CAAC;AAEF,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;CACrB;AAID,qBAAa,sBAAuB,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IAIjE,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,Y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AAW,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,GACpD,OAAO,CAAC,IAAI,CAAC;YA2DF,mCAAmC;YAgBnC,4BAA4B;YAU5B,+BAA+B;YAiB/B,8BAA8B;IAkCrC,yBAAyB,yBACR,WAAW,qBACd,kBAAkB,KACpC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAW5B;IAEK,iCAAiC,sBACnB,kBAAkB,KACpC,OAAO,CACR;QACE,oBAAoB,EAAE,WAAW,CAAC;QAClC,iBAAiB,EAAE,kBAAkB,CAAC;QACtC,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CACJ,CAWC;IAEK,0BAA0B,yBACT,WAAW,qBACd,kBAAkB,WAC5B,MAAM,qBAYf;IAEK,2BAA2B,yBACV,WAAW,qBACd,kBAAkB,mBAUrC;CACH"}
@@ -52,6 +52,7 @@ class SubconversationService extends commons_1.TypedEventEmitter {
52
52
  */
53
53
  async joinConferenceSubconversation(conversationId, groupId, shouldRetry = true) {
54
54
  try {
55
+ this.logger.info('Joining conference subconversation', { conversationId, groupId });
55
56
  const { group_id: subconversationGroupId, epoch: subconversationEpoch, epoch_timestamp: subconversationEpochTimestamp, subconv_id: subconversationId, } = await this.getConferenceSubconversation(conversationId);
56
57
  // We store the mapping between the subconversation and the parent conversation
57
58
  await this.saveSubconversationGroupId(conversationId, subconversationId, subconversationGroupId);
@@ -81,6 +82,7 @@ class SubconversationService extends commons_1.TypedEventEmitter {
81
82
  return { groupId: subconversationGroupId, epoch };
82
83
  }
83
84
  catch (error) {
85
+ this.logger.error('Failed to join conference subconversation', { conversationId, groupId, error, shouldRetry });
84
86
  if (shouldRetry) {
85
87
  return this.joinConferenceSubconversation(conversationId, groupId, false);
86
88
  }
@@ -93,71 +95,132 @@ class SubconversationService extends commons_1.TypedEventEmitter {
93
95
  * @param conversationId Id of the parent conversation which subconversation we want to leave
94
96
  */
95
97
  async leaveConferenceSubconversation(conversationId) {
98
+ this.logger.info('Leaving conference subconversation', { conversationId });
96
99
  const subconversationGroupId = await this.getSubconversationGroupId(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE);
97
100
  if (!subconversationGroupId) {
101
+ this.logger.warn('No subconversation groupId found when leaving conference subconversation', { conversationId });
98
102
  return;
99
103
  }
100
104
  const doesGroupExistLocally = await this.mlsService.conversationExists(subconversationGroupId);
101
105
  if (!doesGroupExistLocally) {
102
106
  // If the subconversation was known by a client but is does not exist locally, we can remove it from the store.
107
+ this.logger.info('Subconversation not found locally; clearing stored mapping', {
108
+ conversationId,
109
+ subconversationId: conversation_1.SUBCONVERSATION_ID.CONFERENCE,
110
+ subconversationGroupId,
111
+ });
103
112
  return this.clearSubconversationGroupId(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE);
104
113
  }
105
114
  try {
106
115
  await this.apiClient.api.conversation.deleteSubconversationSelf(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE);
107
116
  }
108
117
  catch (error) {
109
- this.logger.error(`Failed to leave conference subconversation:`, error);
118
+ this.logger.error('Failed to leave conference subconversation', {
119
+ conversationId,
120
+ subconversationId: conversation_1.SUBCONVERSATION_ID.CONFERENCE,
121
+ subconversationGroupId,
122
+ error,
123
+ });
110
124
  }
111
125
  await this.mlsService.wipeConversation(subconversationGroupId);
112
126
  // once we've left the subconversation, we can remove it from the store
127
+ this.logger.info('Clearing stored mapping after leaving conference subconversation', {
128
+ conversationId,
129
+ subconversationId: conversation_1.SUBCONVERSATION_ID.CONFERENCE,
130
+ subconversationGroupId,
131
+ });
113
132
  await this.clearSubconversationGroupId(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE);
114
133
  }
115
134
  async leaveStaleConferenceSubconversations() {
135
+ this.logger.info('Leaving all stale conference subconversations');
116
136
  const conversationIds = await this.getAllGroupIdsBySubconversationId(conversation_1.SUBCONVERSATION_ID.CONFERENCE);
117
137
  for (const { parentConversationId } of conversationIds) {
138
+ this.logger.debug('Leaving stale conference subconversation for parent conversation', {
139
+ parentConversationId,
140
+ });
118
141
  await this.leaveConferenceSubconversation(parentConversationId);
119
142
  }
120
143
  }
121
144
  async getSubconversationEpochInfo(parentConversationId, parentConversationGroupId, shouldAdvanceEpoch = false) {
145
+ this.logger.info('Getting subconversation epoch info', {
146
+ parentConversationId,
147
+ parentConversationGroupId,
148
+ shouldAdvanceEpoch,
149
+ });
122
150
  const subconversationGroupId = await this.getSubconversationGroupId(parentConversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE);
123
151
  // this method should not be called if the subconversation (and its parent conversation) is not established
124
152
  if (!subconversationGroupId) {
125
- this.logger.error(`Could not obtain epoch info for conference subconversation of conversation ${JSON.stringify(parentConversationId)}: parent or subconversation group ID is missing`);
153
+ this.logger.error('Could not obtain epoch info for conference subconversation: missing groupId', {
154
+ parentConversationId,
155
+ });
126
156
  return null;
127
157
  }
128
158
  //we don't want to react to avs callbacks when conversation was not yet established
129
159
  const doesMLSGroupExist = await this.mlsService.conversationExists(subconversationGroupId);
130
160
  if (!doesMLSGroupExist) {
161
+ this.logger.debug('Subconversation MLS group does not exist locally; skipping epoch info', {
162
+ parentConversationId,
163
+ parentConversationGroupId,
164
+ subconversationGroupId,
165
+ });
131
166
  return null;
132
167
  }
133
168
  const members = await this.generateSubconversationMembers(subconversationGroupId, parentConversationGroupId);
134
169
  if (shouldAdvanceEpoch) {
170
+ this.logger.info('Advancing epoch and renewing key material for subconversation', { subconversationGroupId });
135
171
  await this.mlsService.renewKeyMaterial(subconversationGroupId);
136
172
  }
137
173
  const epoch = Number(await this.mlsService.getEpoch(subconversationGroupId));
138
174
  const secretKey = await this.mlsService.exportSecretKey(subconversationGroupId, MLS_CONVERSATION_KEY_LENGTH);
175
+ this.logger.debug('Obtained subconversation epoch info', {
176
+ parentConversationId,
177
+ parentConversationGroupId,
178
+ subconversationGroupId,
179
+ epoch,
180
+ membersCount: members.length,
181
+ keyLength: MLS_CONVERSATION_KEY_LENGTH,
182
+ });
139
183
  return { members, epoch, keyLength: MLS_CONVERSATION_KEY_LENGTH, secretKey };
140
184
  }
141
185
  async subscribeToEpochUpdates(parentConversationId, parentConversationGroupId, findConversationByGroupId, onEpochUpdate) {
186
+ this.logger.info('Subscribing to subconversation epoch updates', {
187
+ parentConversationId,
188
+ parentConversationGroupId,
189
+ });
142
190
  const { epoch: initialEpoch, groupId: subconversationGroupId } = await this.joinConferenceSubconversation(parentConversationId, parentConversationGroupId);
143
191
  const forwardNewEpoch = async ({ groupId }) => {
192
+ this.logger.debug('Received MLS NEW_EPOCH event', { eventGroupId: groupId, subconversationGroupId });
144
193
  if (groupId !== subconversationGroupId) {
145
194
  // if the epoch update did not happen in the subconversation directly, check if it happened in the parent conversation
146
195
  const parentConversationId = findConversationByGroupId(groupId);
147
196
  if (!parentConversationId) {
197
+ this.logger.debug('Ignoring NEW_EPOCH event: could not map to parent conversation');
148
198
  return;
149
199
  }
150
200
  const foundSubconversationGroupId = await this.getSubconversationGroupId(parentConversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE);
151
201
  // if the conference subconversation of parent conversation is not known, ignore the epoch update
152
202
  if (foundSubconversationGroupId !== subconversationGroupId) {
203
+ this.logger.debug('Ignoring NEW_EPOCH event: not related to subscribed subconversation', {
204
+ eventGroupId: groupId,
205
+ foundSubconversationGroupId,
206
+ expectedSubconversationGroupId: subconversationGroupId,
207
+ });
153
208
  return;
154
209
  }
155
210
  }
156
211
  const subconversationEpochInfo = await this.getSubconversationEpochInfo(parentConversationId, parentConversationGroupId);
157
212
  if (!subconversationEpochInfo) {
213
+ this.logger.debug('No subconversation epoch info available; skipping callback', {
214
+ parentConversationId,
215
+ parentConversationGroupId,
216
+ });
158
217
  return;
159
218
  }
160
219
  const newSubconversationEpoch = Number(await this.mlsService.getEpoch(subconversationGroupId));
220
+ this.logger.info('Forwarding epoch update to subscriber', {
221
+ subconversationGroupId,
222
+ epoch: newSubconversationEpoch,
223
+ });
161
224
  return onEpochUpdate({
162
225
  ...subconversationEpochInfo,
163
226
  epoch: newSubconversationEpoch,
@@ -165,15 +228,26 @@ class SubconversationService extends commons_1.TypedEventEmitter {
165
228
  };
166
229
  this.mlsService.on(mls_1.MLSServiceEvents.NEW_EPOCH, forwardNewEpoch);
167
230
  await forwardNewEpoch({ groupId: subconversationGroupId, epoch: initialEpoch });
231
+ this.logger.info('Subscribed to MLS NEW_EPOCH events for subconversation', { subconversationGroupId });
168
232
  return () => this.mlsService.off(mls_1.MLSServiceEvents.NEW_EPOCH, forwardNewEpoch);
169
233
  }
170
234
  async removeClientFromConferenceSubconversation(conversationId, clientToRemove) {
235
+ this.logger.info('Removing client from conference subconversation', {
236
+ conversationId,
237
+ user: clientToRemove.user,
238
+ clientId: clientToRemove.clientId,
239
+ });
171
240
  const subconversationGroupId = await this.getSubconversationGroupId(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE);
172
241
  if (!subconversationGroupId) {
242
+ this.logger.warn('Cannot remove client: subconversation groupId missing', { conversationId });
173
243
  return;
174
244
  }
175
245
  const doesMLSGroupExist = await this.mlsService.conversationExists(subconversationGroupId);
176
246
  if (!doesMLSGroupExist) {
247
+ this.logger.debug('Cannot remove client: subconversation MLS group does not exist locally', {
248
+ conversationId,
249
+ subconversationGroupId,
250
+ });
177
251
  return;
178
252
  }
179
253
  const { user: { id: userId, domain }, clientId, } = clientToRemove;
@@ -181,23 +255,70 @@ class SubconversationService extends commons_1.TypedEventEmitter {
181
255
  const subconversationMembers = await this.mlsService.getClientIds(subconversationGroupId);
182
256
  const isSubconversationMember = subconversationMembers.some(({ userId, clientId, domain }) => (0, fullyQualifiedClientIdUtils_1.constructFullyQualifiedClientId)(userId, clientId, domain) === clientToRemoveQualifiedId);
183
257
  if (!isSubconversationMember) {
258
+ this.logger.info('Client is not a member of the subconversation; nothing to remove', {
259
+ conversationId,
260
+ subconversationGroupId,
261
+ clientToRemoveQualifiedId,
262
+ });
184
263
  return;
185
264
  }
186
- return void this.mlsService.removeClientsFromConversation(subconversationGroupId, [clientToRemoveQualifiedId]);
265
+ this.logger.info('Removing client from subconversation', {
266
+ subconversationGroupId,
267
+ clientToRemoveQualifiedId,
268
+ });
269
+ try {
270
+ await this.mlsService.removeClientsFromConversation(subconversationGroupId, [clientToRemoveQualifiedId]);
271
+ }
272
+ catch (error) {
273
+ this.logger.error('Failed to remove client from subconversation', {
274
+ subconversationGroupId,
275
+ clientToRemoveQualifiedId,
276
+ error,
277
+ });
278
+ }
187
279
  }
188
280
  async joinSubconversationByExternalCommit(conversationId, subconversation) {
189
- await this.mlsService.joinByExternalCommit(() => this.apiClient.api.conversation.getSubconversationGroupInfo(conversationId, subconversation));
281
+ try {
282
+ this.logger.info('Joining subconversation by external commit', { conversationId, subconversation });
283
+ await this.mlsService.joinByExternalCommit(() => this.apiClient.api.conversation.getSubconversationGroupInfo(conversationId, subconversation));
284
+ }
285
+ catch (error) {
286
+ this.logger.error('Failed to join subconversation by external commit', {
287
+ conversationId,
288
+ subconversation,
289
+ error,
290
+ });
291
+ throw error;
292
+ }
190
293
  }
191
294
  async getConferenceSubconversation(conversationId) {
192
- return this.apiClient.api.conversation.getSubconversation(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE);
295
+ this.logger.debug('Fetching conference subconversation metadata', { conversationId });
296
+ try {
297
+ return await this.apiClient.api.conversation.getSubconversation(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE);
298
+ }
299
+ catch (error) {
300
+ this.logger.error('Failed to fetch conference subconversation metadata', { conversationId, error });
301
+ throw error;
302
+ }
193
303
  }
194
304
  async deleteConferenceSubconversation(conversationId, data) {
195
- return this.apiClient.api.conversation.deleteSubconversation(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE, data);
305
+ this.logger.info('Deleting conference subconversation', { conversationId, data });
306
+ try {
307
+ return await this.apiClient.api.conversation.deleteSubconversation(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE, data);
308
+ }
309
+ catch (error) {
310
+ this.logger.error('Failed to delete conference subconversation', { conversationId, data, error });
311
+ throw error;
312
+ }
196
313
  }
197
314
  async generateSubconversationMembers(subconversationGroupId, parentGroupId) {
315
+ this.logger.debug('Generating subconversation members info', {
316
+ subconversationGroupId,
317
+ parentGroupId,
318
+ });
198
319
  const subconversationMemberIds = await this.mlsService.getClientIds(subconversationGroupId);
199
320
  const parentMemberIds = await this.mlsService.getClientIds(parentGroupId);
200
- return parentMemberIds.map(parentMember => {
321
+ const members = parentMemberIds.map(parentMember => {
201
322
  const isSubconversationMember = subconversationMemberIds.some(({ userId, clientId, domain }) => (0, fullyQualifiedClientIdUtils_1.constructFullyQualifiedClientId)(userId, clientId, domain) ===
202
323
  (0, fullyQualifiedClientIdUtils_1.constructFullyQualifiedClientId)(parentMember.userId, parentMember.clientId, parentMember.domain));
203
324
  return {
@@ -208,20 +329,45 @@ class SubconversationService extends commons_1.TypedEventEmitter {
208
329
  in_subconv: isSubconversationMember,
209
330
  };
210
331
  });
332
+ this.logger.debug('Generated subconversation members info', {
333
+ subconversationGroupId,
334
+ parentGroupId,
335
+ membersCount: members.length,
336
+ });
337
+ return members;
211
338
  }
212
339
  getSubconversationGroupId = async (parentConversationId, subconversationId) => {
213
340
  const foundSubconversation = await this.coreDatabase.get('subconversations', (0, subconversationUtil_1.generateSubconversationStoreKey)(parentConversationId, subconversationId));
341
+ this.logger.debug('Loaded subconversation groupId from store', {
342
+ parentConversationId,
343
+ subconversationId,
344
+ found: Boolean(foundSubconversation?.groupId),
345
+ });
214
346
  return foundSubconversation?.groupId;
215
347
  };
216
348
  getAllGroupIdsBySubconversationId = async (subconversationId) => {
349
+ this.logger.debug('Retrieving all subconversations by subconversationId', { subconversationId });
217
350
  const allSubconversations = await this.coreDatabase.getAll('subconversations');
218
351
  const foundSubconversations = allSubconversations.filter(subconversation => subconversation.subconversationId === subconversationId);
352
+ this.logger.debug('Found subconversations by id', {
353
+ subconversationId,
354
+ count: foundSubconversations.length,
355
+ });
219
356
  return foundSubconversations;
220
357
  };
221
358
  saveSubconversationGroupId = async (parentConversationId, subconversationId, groupId) => {
359
+ this.logger.debug('Saving subconversation groupId mapping', {
360
+ parentConversationId,
361
+ subconversationId,
362
+ groupId,
363
+ });
222
364
  return this.coreDatabase.put('subconversations', { parentConversationId, subconversationId, groupId }, (0, subconversationUtil_1.generateSubconversationStoreKey)(parentConversationId, subconversationId));
223
365
  };
224
366
  clearSubconversationGroupId = async (parentConversationId, subconversationId) => {
367
+ this.logger.debug('Clearing subconversation groupId mapping', {
368
+ parentConversationId,
369
+ subconversationId,
370
+ });
225
371
  return this.coreDatabase.delete('subconversations', (0, subconversationUtil_1.generateSubconversationStoreKey)(parentConversationId, subconversationId));
226
372
  };
227
373
  }
package/package.json CHANGED
@@ -11,16 +11,16 @@
11
11
  "./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
12
12
  },
13
13
  "dependencies": {
14
- "@wireapp/api-client": "^27.82.0",
15
- "@wireapp/commons": "^5.4.5",
14
+ "@wireapp/api-client": "^27.83.0",
15
+ "@wireapp/commons": "^5.4.9",
16
16
  "@wireapp/core-crypto": "9.1.0",
17
17
  "@wireapp/cryptobox": "12.8.0",
18
- "@wireapp/priority-queue": "^2.1.12",
19
- "@wireapp/promise-queue": "^2.4.5",
18
+ "@wireapp/priority-queue": "^2.1.16",
19
+ "@wireapp/promise-queue": "^2.4.9",
20
20
  "@wireapp/protocol-messaging": "1.53.0",
21
- "@wireapp/store-engine": "^5.1.12",
21
+ "@wireapp/store-engine": "^5.1.16",
22
22
  "axios": "1.12.2",
23
- "bazinga64": "^6.5.3",
23
+ "bazinga64": "^6.5.7",
24
24
  "deepmerge-ts": "6.0.0",
25
25
  "hash.js": "1.1.7",
26
26
  "http-status-codes": "2.3.0",
@@ -61,6 +61,6 @@
61
61
  "test:coverage": "jest --coverage",
62
62
  "watch": "tsc --watch"
63
63
  },
64
- "version": "46.40.0",
65
- "gitHead": "28ddfb822c9e80262e718a5c1d89dc2878f72dd4"
64
+ "version": "46.40.7",
65
+ "gitHead": "5e0809cae872c8f565e8ddbd08cd02c77575755c"
66
66
  }