@wireapp/core 46.43.0 → 46.45.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/lib/Account.d.ts +1 -1
- package/lib/Account.d.ts.map +1 -1
- package/lib/Account.js +1 -1
- package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.js +40 -8
- package/lib/conversation/ConversationService/ConversationService.test.js +216 -25
- package/lib/conversation/ConversationService/ConversationService.types.d.ts +4 -3
- package/lib/conversation/ConversationService/ConversationService.types.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.test.js +8 -7
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts +3 -2
- package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/WithMockedGenerics.test.js +4 -4
- package/lib/self/SelfService.d.ts +2 -2
- package/lib/self/SelfService.d.ts.map +1 -1
- package/lib/self/SelfService.test.js +2 -2
- package/lib/user/UserService.d.ts +2 -2
- package/lib/user/UserService.d.ts.map +1 -1
- package/lib/user/UserService.js +3 -3
- package/lib/util/TypePredicateUtil.d.ts.map +1 -1
- package/lib/util/TypePredicateUtil.js +2 -2
- package/package.json +3 -3
package/lib/Account.d.ts
CHANGED
|
@@ -335,7 +335,7 @@ export declare class Account extends TypedEventEmitter<Events> {
|
|
|
335
335
|
private readonly initEngine;
|
|
336
336
|
private readonly groupIdFromConversationId;
|
|
337
337
|
isMLSActiveForClient: () => Promise<boolean>;
|
|
338
|
-
private isMLSConversationRecoveryEnabled;
|
|
338
|
+
private readonly isMLSConversationRecoveryEnabled;
|
|
339
339
|
}
|
|
340
340
|
export {};
|
|
341
341
|
//# sourceMappingURL=Account.d.ts.map
|
package/lib/Account.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../src/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CAAC,QAAQ,CAAC,yBAAyB,CAgBxC;IAEK,qBAAqB,2BAE1B;IAEF,OAAc,iBAAiB,iBACf,YAAY,GAAG,sBAAsB,KAClD,YAAY,IAAI,sBAAsB,CAEvC;IAEF,OAAc,yBAAyB,iBACvB,YAAY,GAAG,sBAAsB,KAClD,YAAY,IAAI,YAAY,CAE7B;IAEF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAG7B;IAEF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAEjC;IAEF,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAEtC;IAEF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAqBzB;IAEF,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CASxC;IAEK,oBAAoB,QAAa,OAAO,CAAC,OAAO,CAAC,CAetD;IAEF,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAG/C;CACH"}
|
package/lib/Account.js
CHANGED
|
@@ -897,7 +897,7 @@ class Account extends commons_1.TypedEventEmitter {
|
|
|
897
897
|
}
|
|
898
898
|
// Check if MLS is enabled for the public via backend feature flag
|
|
899
899
|
const commonConfig = (await this.service?.team.getCommonFeatureConfig()) ?? {};
|
|
900
|
-
return commonConfig[team_1.FEATURE_KEY.MLS]?.status === team_1.
|
|
900
|
+
return commonConfig[team_1.FEATURE_KEY.MLS]?.status === team_1.FEATURE_STATUS.ENABLED;
|
|
901
901
|
};
|
|
902
902
|
isMLSConversationRecoveryEnabled = async () => {
|
|
903
903
|
const commonConfig = (await this.service?.team.getCommonFeatureConfig()) ?? {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/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c,GACf,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,WAAW,CAAC;QAC5B,UAAU,EAAE,WAAW,CAAC;QACxB,cAAc,EAAE,WAAW,EAAE,CAAC;KAC/B,GAAG,OAAO,CAAC,IAAI,CAAC;YAkCH,wBAAwB;YAsBxB,gCAAgC;YA0BhC,4BAA4B;IA2B1C,OAAO,CAAC,2BAA2B;IAmBnC;;;OAGG;YACW,uCAAuC;YA4BvC,wBAAwB;YAIxB,yBAAyB;IAKvC;;;;OAIG;IACU,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAoB3E"}
|
|
@@ -22,6 +22,7 @@ exports.ConversationService = void 0;
|
|
|
22
22
|
const conversation_1 = require("@wireapp/api-client/lib/conversation");
|
|
23
23
|
const data_1 = require("@wireapp/api-client/lib/conversation/data");
|
|
24
24
|
const event_1 = require("@wireapp/api-client/lib/event");
|
|
25
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
25
26
|
const bazinga64_1 = require("bazinga64");
|
|
26
27
|
const commons_1 = require("@wireapp/commons");
|
|
27
28
|
const core_crypto_1 = require("@wireapp/core-crypto");
|
|
@@ -131,7 +132,7 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
131
132
|
*/
|
|
132
133
|
async send(params) {
|
|
133
134
|
function isMLS(params) {
|
|
134
|
-
return params.protocol ===
|
|
135
|
+
return params.protocol === team_1.CONVERSATION_PROTOCOL.MLS;
|
|
135
136
|
}
|
|
136
137
|
return (0, messageSender_1.sendMessage)(() => (isMLS(params) ? this.sendMLSMessage(params) : this.proteusService.sendMessage(params)));
|
|
137
138
|
}
|
|
@@ -363,6 +364,19 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
363
364
|
this.logger.warn("Tried to add users to MLS conversation but it's broken, resetting the conversation", error);
|
|
364
365
|
return this.handleBrokenMLSConversation(conversationId, newGroupId => this.addUsersToMLSConversation({ qualifiedUsers, groupId: newGroupId, conversationId, shouldRetry: false }));
|
|
365
366
|
}
|
|
367
|
+
if ((0, CoreCryptoMLSError_1.isMLSStaleMessageError)(error)) {
|
|
368
|
+
this.logger.info('Failed to add users to MLS conversation because of stale message, recovering by joining with external commit', {
|
|
369
|
+
error,
|
|
370
|
+
groupId,
|
|
371
|
+
});
|
|
372
|
+
await this.recoverMLSGroupFromEpochMismatch(conversationId);
|
|
373
|
+
return this.addUsersToMLSConversation({
|
|
374
|
+
groupId,
|
|
375
|
+
conversationId,
|
|
376
|
+
qualifiedUsers,
|
|
377
|
+
shouldRetry: false,
|
|
378
|
+
});
|
|
379
|
+
}
|
|
366
380
|
if ((0, CoreCryptoMLSError_1.isMLSGroupOutOfSyncError)(error)) {
|
|
367
381
|
this.logger.info('Failed to send MLS message because of group out of sync, recovering by adding missing users', {
|
|
368
382
|
error,
|
|
@@ -402,6 +416,13 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
402
416
|
shouldRetry: false,
|
|
403
417
|
}));
|
|
404
418
|
}
|
|
419
|
+
if ((0, CoreCryptoMLSError_1.isMLSStaleMessageError)(error)) {
|
|
420
|
+
this.logger.info('Failed to remove users from MLS conversation because of stale message, recovering by joining with external commit', {
|
|
421
|
+
error,
|
|
422
|
+
groupId,
|
|
423
|
+
});
|
|
424
|
+
await this.recoverMLSGroupFromEpochMismatch(conversationId);
|
|
425
|
+
}
|
|
405
426
|
if ((0, CoreCryptoMLSError_1.isMLSGroupOutOfSyncError)(error)) {
|
|
406
427
|
this.logger.info('Failed to send MLS message because of group out of sync, recovering by adding missing users', {
|
|
407
428
|
error,
|
|
@@ -413,14 +434,13 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
413
434
|
conversationId,
|
|
414
435
|
qualifiedUsers: missingUsers,
|
|
415
436
|
});
|
|
416
|
-
return this.removeUsersFromMLSConversation({
|
|
417
|
-
groupId,
|
|
418
|
-
conversationId,
|
|
419
|
-
qualifiedUserIds,
|
|
420
|
-
shouldRetry: false,
|
|
421
|
-
});
|
|
422
437
|
}
|
|
423
|
-
|
|
438
|
+
return this.removeUsersFromMLSConversation({
|
|
439
|
+
groupId,
|
|
440
|
+
conversationId,
|
|
441
|
+
qualifiedUserIds,
|
|
442
|
+
shouldRetry: false,
|
|
443
|
+
});
|
|
424
444
|
}
|
|
425
445
|
}
|
|
426
446
|
async joinByExternalCommit(conversationId, shouldRetry = true) {
|
|
@@ -437,6 +457,11 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
437
457
|
this.logger.info('Resetting MLS conversation due to broken mls conversation error', error);
|
|
438
458
|
return this.handleBrokenMLSConversation(conversationId);
|
|
439
459
|
}
|
|
460
|
+
if ((0, CoreCryptoMLSError_1.isMLSStaleMessageError)(error)) {
|
|
461
|
+
this.logger.info('Failed to join MLS conversation with external commit because of stale message, recovering by joining with external commit', { error, conversationId });
|
|
462
|
+
await this.recoverMLSGroupFromEpochMismatch(conversationId);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
440
465
|
throw error;
|
|
441
466
|
}
|
|
442
467
|
}
|
|
@@ -473,6 +498,13 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
473
498
|
this.logger.info('Tried to update key material for a broken MLS conversation, initiating reset', error);
|
|
474
499
|
return this.handleBrokenMLSConversation(conversation.qualified_id);
|
|
475
500
|
}
|
|
501
|
+
if ((0, CoreCryptoMLSError_1.isMLSStaleMessageError)(error)) {
|
|
502
|
+
this.logger.info('Tried to update key material for a stale MLS conversation, recovering by joining with external commit', {
|
|
503
|
+
error,
|
|
504
|
+
groupId,
|
|
505
|
+
});
|
|
506
|
+
await this.recoverMLSGroupFromEpochMismatch(conversation.qualified_id);
|
|
507
|
+
}
|
|
476
508
|
if ((0, CoreCryptoMLSError_1.isMLSGroupOutOfSyncError)(error)) {
|
|
477
509
|
this.logger.info('Tried to update key material for an out of sync conversation, recovering by adding missing users', {
|
|
478
510
|
error,
|
|
@@ -45,6 +45,7 @@ const client_1 = require("@wireapp/api-client/lib/client");
|
|
|
45
45
|
const conversation_1 = require("@wireapp/api-client/lib/conversation");
|
|
46
46
|
const event_1 = require("@wireapp/api-client/lib/event");
|
|
47
47
|
const http_1 = require("@wireapp/api-client/lib/http");
|
|
48
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
48
49
|
const http_status_codes_1 = require("http-status-codes");
|
|
49
50
|
const api_client_1 = require("@wireapp/api-client");
|
|
50
51
|
const core_crypto_1 = require("@wireapp/core-crypto");
|
|
@@ -108,7 +109,7 @@ describe('ConversationService', () => {
|
|
|
108
109
|
}));
|
|
109
110
|
jest
|
|
110
111
|
.spyOn(client.api.user, 'getUserSupportedProtocols')
|
|
111
|
-
.mockReturnValue(Promise.resolve([
|
|
112
|
+
.mockReturnValue(Promise.resolve([team_1.CONVERSATION_PROTOCOL.MLS, team_1.CONVERSATION_PROTOCOL.PROTEUS]));
|
|
112
113
|
client.context = {
|
|
113
114
|
clientType: client_1.ClientType.NONE,
|
|
114
115
|
userId: PayloadHelper.getUUID(),
|
|
@@ -130,6 +131,7 @@ describe('ConversationService', () => {
|
|
|
130
131
|
getClientIdsInGroup: jest.fn(),
|
|
131
132
|
getKeyPackagesPayload: jest.fn(),
|
|
132
133
|
addUsersToExistingConversation: jest.fn(),
|
|
134
|
+
removeClientsFromConversation: jest.fn(),
|
|
133
135
|
resetKeyMaterialRenewal: jest.fn(),
|
|
134
136
|
handleMLSWelcomeMessageEvent: jest.fn(),
|
|
135
137
|
};
|
|
@@ -161,7 +163,7 @@ describe('ConversationService', () => {
|
|
|
161
163
|
const sentTime = new Date().toISOString();
|
|
162
164
|
mockedProteusService.sendMessage = jest.fn().mockResolvedValue({ sentAt: sentTime });
|
|
163
165
|
const promise = conversationService.send({
|
|
164
|
-
protocol:
|
|
166
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
165
167
|
conversationId: { id: 'conv1', domain: '' },
|
|
166
168
|
payload: message,
|
|
167
169
|
});
|
|
@@ -170,6 +172,80 @@ describe('ConversationService', () => {
|
|
|
170
172
|
});
|
|
171
173
|
});
|
|
172
174
|
});
|
|
175
|
+
describe('removeUsersFromMLSConversation', () => {
|
|
176
|
+
it('recovers and retries when stale-message occurs during remove users commit upload', async () => {
|
|
177
|
+
const [conversationService, { apiClient, mlsService }] = await buildConversationService();
|
|
178
|
+
const mockGroupId = 'groupId-stale-remove';
|
|
179
|
+
const mockConversationId = { id: PayloadHelper.getUUID(), domain: 'staging.zinfra.io' };
|
|
180
|
+
const qualifiedUserIds = [
|
|
181
|
+
{ id: 'test-id-1', domain: 'test-domain' },
|
|
182
|
+
{ id: 'test-id-2', domain: 'test-domain' },
|
|
183
|
+
];
|
|
184
|
+
const staleMessageError = {
|
|
185
|
+
type: core_crypto_1.ErrorType.Mls,
|
|
186
|
+
context: {
|
|
187
|
+
type: core_crypto_1.MlsErrorType.MessageRejected,
|
|
188
|
+
context: {
|
|
189
|
+
reason: (0, CoreCryptoMLSError_1.serializeAbortReason)({ message: CoreCryptoMLSError_1.UPLOAD_COMMIT_BUNDLE_ABORT_REASONS.MLS_STALE_MESSAGE }),
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
// First removal attempt fails with stale, second succeeds
|
|
194
|
+
jest
|
|
195
|
+
.spyOn(mlsService, 'removeClientsFromConversation')
|
|
196
|
+
.mockRejectedValueOnce(staleMessageError)
|
|
197
|
+
.mockResolvedValueOnce(undefined);
|
|
198
|
+
const remoteEpoch = 6;
|
|
199
|
+
const localEpoch = 5;
|
|
200
|
+
jest.spyOn(mlsService, 'conversationExists').mockResolvedValueOnce(true);
|
|
201
|
+
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
202
|
+
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValue({
|
|
203
|
+
qualified_id: mockConversationId,
|
|
204
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
205
|
+
epoch: remoteEpoch,
|
|
206
|
+
group_id: mockGroupId,
|
|
207
|
+
});
|
|
208
|
+
await conversationService.removeUsersFromMLSConversation({
|
|
209
|
+
groupId: mockGroupId,
|
|
210
|
+
conversationId: mockConversationId,
|
|
211
|
+
qualifiedUserIds,
|
|
212
|
+
});
|
|
213
|
+
expect(conversationService.joinByExternalCommit).toHaveBeenCalledWith(mockConversationId);
|
|
214
|
+
expect(mlsService.removeClientsFromConversation).toHaveBeenCalledTimes(2);
|
|
215
|
+
expect(mlsService.resetKeyMaterialRenewal).toHaveBeenCalledWith(mockGroupId);
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
describe('joinByExternalCommit', () => {
|
|
219
|
+
it('retries join when stale-message occurs during external commit join', async () => {
|
|
220
|
+
const [conversationService, { apiClient, mlsService }] = await buildConversationService();
|
|
221
|
+
const conversationId = { id: 'conv-join-stale', domain: 'staging.zinfra.io' };
|
|
222
|
+
const staleMessageError = {
|
|
223
|
+
type: core_crypto_1.ErrorType.Mls,
|
|
224
|
+
context: {
|
|
225
|
+
type: core_crypto_1.MlsErrorType.MessageRejected,
|
|
226
|
+
context: {
|
|
227
|
+
reason: (0, CoreCryptoMLSError_1.serializeAbortReason)({ message: CoreCryptoMLSError_1.UPLOAD_COMMIT_BUNDLE_ABORT_REASONS.MLS_STALE_MESSAGE }),
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
jest
|
|
232
|
+
.spyOn(mlsService, 'joinByExternalCommit')
|
|
233
|
+
.mockRejectedValueOnce(staleMessageError)
|
|
234
|
+
.mockResolvedValueOnce(undefined);
|
|
235
|
+
const remoteEpoch = 10;
|
|
236
|
+
const localEpoch = 9;
|
|
237
|
+
jest.spyOn(mlsService, 'conversationExists').mockResolvedValueOnce(true);
|
|
238
|
+
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
239
|
+
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
240
|
+
qualified_id: conversationId,
|
|
241
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
242
|
+
epoch: remoteEpoch,
|
|
243
|
+
group_id: 'gid-join-stale',
|
|
244
|
+
});
|
|
245
|
+
await conversationService.joinByExternalCommit(conversationId);
|
|
246
|
+
expect(mlsService.joinByExternalCommit).toHaveBeenCalledTimes(2);
|
|
247
|
+
});
|
|
248
|
+
});
|
|
173
249
|
describe('"send MLS"', () => {
|
|
174
250
|
const groupId = PayloadHelper.getUUID();
|
|
175
251
|
const messages = [
|
|
@@ -185,7 +261,7 @@ describe('ConversationService', () => {
|
|
|
185
261
|
it(`calls callbacks when sending '${type}' message is starting and successful`, async () => {
|
|
186
262
|
const [conversationService] = await buildConversationService();
|
|
187
263
|
const promise = conversationService.send({
|
|
188
|
-
protocol:
|
|
264
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
189
265
|
groupId,
|
|
190
266
|
payload: message,
|
|
191
267
|
conversationId: { id: '', domain: '' },
|
|
@@ -194,6 +270,43 @@ describe('ConversationService', () => {
|
|
|
194
270
|
expect(result.state).toBe(__1.MessageSendingState.OUTGOING_SENT);
|
|
195
271
|
});
|
|
196
272
|
});
|
|
273
|
+
it('rejoins a MLS group when stale-message error occurs during commit bundle upload', async () => {
|
|
274
|
+
const [conversationService, { apiClient, mlsService }] = await buildConversationService();
|
|
275
|
+
const mockGroupId = 'AAEAAH87aajaQ011i+rNLmwpy0sAZGl5YS53aXJlamxpbms=';
|
|
276
|
+
const mockConversationId = { id: 'mockConversationId', domain: 'staging.zinfra.io' };
|
|
277
|
+
const mockedMessage = MessageBuilder.buildTextMessage({ text: 'test' });
|
|
278
|
+
const staleMessageError = new conversation_1.MLSStaleMessageError('', http_1.BackendErrorLabel.MLS_STALE_MESSAGE, http_status_codes_1.StatusCodes.CONFLICT);
|
|
279
|
+
// First attempt to upload commit bundle fails with stale-message, second attempt succeeds
|
|
280
|
+
jest
|
|
281
|
+
.spyOn(mlsService, 'commitPendingProposals')
|
|
282
|
+
.mockRejectedValueOnce(staleMessageError)
|
|
283
|
+
.mockResolvedValueOnce(undefined);
|
|
284
|
+
const remoteEpoch = 5;
|
|
285
|
+
const localEpoch = 4;
|
|
286
|
+
jest.spyOn(mlsService, 'conversationExists').mockResolvedValueOnce(true);
|
|
287
|
+
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
288
|
+
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
289
|
+
qualified_id: mockConversationId,
|
|
290
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
291
|
+
epoch: remoteEpoch,
|
|
292
|
+
group_id: mockGroupId,
|
|
293
|
+
});
|
|
294
|
+
await conversationService.send({
|
|
295
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
296
|
+
groupId: mockGroupId,
|
|
297
|
+
payload: mockedMessage,
|
|
298
|
+
conversationId: mockConversationId,
|
|
299
|
+
});
|
|
300
|
+
// Recovery via external commit should have been triggered
|
|
301
|
+
expect(conversationService.joinByExternalCommit).toHaveBeenCalledWith(mockConversationId);
|
|
302
|
+
expect(conversationService.emit).toHaveBeenCalledWith('MLSConversationRecovered', {
|
|
303
|
+
conversationId: mockConversationId,
|
|
304
|
+
});
|
|
305
|
+
// Because the failure happened before posting the message, postMlsMessage should be called only once (after recovery)
|
|
306
|
+
expect(apiClient.api.conversation.postMlsMessage).toHaveBeenCalledTimes(1);
|
|
307
|
+
// commitPendingProposals is called twice: first fails, second succeeds
|
|
308
|
+
expect(mlsService.commitPendingProposals).toHaveBeenCalledTimes(2);
|
|
309
|
+
});
|
|
197
310
|
it('rejoins a MLS group when failed encrypting MLS message', async () => {
|
|
198
311
|
const [conversationService, { apiClient, mlsService }] = await buildConversationService();
|
|
199
312
|
const mockGroupId = 'AAEAAH87aajaQ011i+rNLmwpy0sAZGl5YS53aXJlamxpbms=';
|
|
@@ -207,12 +320,12 @@ describe('ConversationService', () => {
|
|
|
207
320
|
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
208
321
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
209
322
|
qualified_id: mockConversationId,
|
|
210
|
-
protocol:
|
|
323
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
211
324
|
epoch: remoteEpoch,
|
|
212
325
|
group_id: mockGroupId,
|
|
213
326
|
});
|
|
214
327
|
await conversationService.send({
|
|
215
|
-
protocol:
|
|
328
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
216
329
|
groupId: mockGroupId,
|
|
217
330
|
payload: mockedMessage,
|
|
218
331
|
conversationId: mockConversationId,
|
|
@@ -239,7 +352,7 @@ describe('ConversationService', () => {
|
|
|
239
352
|
.spyOn(conversationService, 'addUsersToMLSConversation')
|
|
240
353
|
.mockResolvedValueOnce({ conversation: { members: { others: [] } } });
|
|
241
354
|
await conversationService.send({
|
|
242
|
-
protocol:
|
|
355
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
243
356
|
groupId: mockGroupId,
|
|
244
357
|
payload: mockedMessage,
|
|
245
358
|
conversationId: mockConversationId,
|
|
@@ -260,7 +373,7 @@ describe('ConversationService', () => {
|
|
|
260
373
|
return {
|
|
261
374
|
group_id: 'group-id',
|
|
262
375
|
qualified_id: { id: conversationId || 'conversation-id', domain: 'staging.zinfra.io' },
|
|
263
|
-
protocol:
|
|
376
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
264
377
|
epoch,
|
|
265
378
|
};
|
|
266
379
|
};
|
|
@@ -310,7 +423,7 @@ describe('ConversationService', () => {
|
|
|
310
423
|
const remoteEpoch = 1;
|
|
311
424
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
312
425
|
qualified_id: mockConversationId,
|
|
313
|
-
protocol:
|
|
426
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
314
427
|
epoch: remoteEpoch,
|
|
315
428
|
group_id: mockGroupId,
|
|
316
429
|
});
|
|
@@ -329,14 +442,14 @@ describe('ConversationService', () => {
|
|
|
329
442
|
const updatedEpoch = 2;
|
|
330
443
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
331
444
|
qualified_id: mockConversationId,
|
|
332
|
-
protocol:
|
|
445
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
333
446
|
epoch: remoteEpoch,
|
|
334
447
|
group_id: mockGroupId,
|
|
335
448
|
});
|
|
336
449
|
// The 2nd request we make after joining the conversation with external commit
|
|
337
450
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
338
451
|
qualified_id: mockConversationId,
|
|
339
|
-
protocol:
|
|
452
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
340
453
|
epoch: updatedEpoch,
|
|
341
454
|
group_id: mockGroupId,
|
|
342
455
|
});
|
|
@@ -357,14 +470,14 @@ describe('ConversationService', () => {
|
|
|
357
470
|
const updatedEpoch = 1;
|
|
358
471
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
359
472
|
qualified_id: mockConversationId,
|
|
360
|
-
protocol:
|
|
473
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
361
474
|
epoch: remoteEpoch,
|
|
362
475
|
group_id: mockGroupId,
|
|
363
476
|
});
|
|
364
477
|
// The 2nd request we make after successfully registering a group
|
|
365
478
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
366
479
|
qualified_id: mockConversationId,
|
|
367
|
-
protocol:
|
|
480
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
368
481
|
epoch: updatedEpoch,
|
|
369
482
|
group_id: mockGroupId,
|
|
370
483
|
});
|
|
@@ -386,21 +499,21 @@ describe('ConversationService', () => {
|
|
|
386
499
|
const updatedEpoch = 1;
|
|
387
500
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
388
501
|
qualified_id: mockConversationId,
|
|
389
|
-
protocol:
|
|
502
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
390
503
|
epoch: remoteEpoch,
|
|
391
504
|
group_id: mockGroupId,
|
|
392
505
|
});
|
|
393
506
|
// The 2nd request we make when retrying to register the conversation
|
|
394
507
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
395
508
|
qualified_id: mockConversationId,
|
|
396
|
-
protocol:
|
|
509
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
397
510
|
epoch: remoteEpoch,
|
|
398
511
|
group_id: mockGroupId,
|
|
399
512
|
});
|
|
400
513
|
// The 3rd request we make after successfully registering a group
|
|
401
514
|
jest.spyOn(apiClient.api.conversation, 'getMLS1to1Conversation').mockResolvedValueOnce({
|
|
402
515
|
qualified_id: mockConversationId,
|
|
403
|
-
protocol:
|
|
516
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
404
517
|
epoch: updatedEpoch,
|
|
405
518
|
group_id: mockGroupId,
|
|
406
519
|
});
|
|
@@ -429,7 +542,7 @@ describe('ConversationService', () => {
|
|
|
429
542
|
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
430
543
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
431
544
|
qualified_id: conversationId,
|
|
432
|
-
protocol:
|
|
545
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
433
546
|
epoch: remoteEpoch,
|
|
434
547
|
group_id: mockGroupId,
|
|
435
548
|
});
|
|
@@ -473,7 +586,7 @@ describe('ConversationService', () => {
|
|
|
473
586
|
jest.spyOn(mlsService, 'handleMLSWelcomeMessageEvent').mockRejectedValueOnce(orphanWelcomeMessageError);
|
|
474
587
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
475
588
|
qualified_id: conversationId,
|
|
476
|
-
protocol:
|
|
589
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
477
590
|
});
|
|
478
591
|
await conversationService.handleEvent(mockMLSWelcomeMessageEvent);
|
|
479
592
|
await new Promise(resolve => setImmediate(resolve));
|
|
@@ -549,7 +662,7 @@ describe('ConversationService', () => {
|
|
|
549
662
|
.mockResolvedValueOnce({ keyPackages: [new Uint8Array(0)], failures: [] });
|
|
550
663
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
551
664
|
qualified_id: mockConversationId,
|
|
552
|
-
protocol:
|
|
665
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
553
666
|
epoch: 1,
|
|
554
667
|
group_id: mockGroupId,
|
|
555
668
|
});
|
|
@@ -577,9 +690,9 @@ describe('ConversationService', () => {
|
|
|
577
690
|
};
|
|
578
691
|
jest.spyOn(apiClient.api.user, 'getUserSupportedProtocols').mockImplementation(id => {
|
|
579
692
|
if (id === otherUsersToAdd[2]) {
|
|
580
|
-
return Promise.resolve([
|
|
693
|
+
return Promise.resolve([team_1.CONVERSATION_PROTOCOL.PROTEUS]);
|
|
581
694
|
}
|
|
582
|
-
return Promise.resolve([
|
|
695
|
+
return Promise.resolve([team_1.CONVERSATION_PROTOCOL.MLS, team_1.CONVERSATION_PROTOCOL.PROTEUS]);
|
|
583
696
|
});
|
|
584
697
|
jest.spyOn(mlsService, 'getKeyPackagesPayload').mockResolvedValueOnce({
|
|
585
698
|
keyPackages: [new Uint8Array(0)],
|
|
@@ -587,7 +700,7 @@ describe('ConversationService', () => {
|
|
|
587
700
|
});
|
|
588
701
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
589
702
|
qualified_id: mockConversationId,
|
|
590
|
-
protocol:
|
|
703
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
591
704
|
epoch: 1,
|
|
592
705
|
group_id: mockGroupId,
|
|
593
706
|
});
|
|
@@ -599,6 +712,52 @@ describe('ConversationService', () => {
|
|
|
599
712
|
});
|
|
600
713
|
expect(failedToAdd).toEqual([keysClaimingFailure]);
|
|
601
714
|
});
|
|
715
|
+
it('recovers and retries when stale-message occurs during add users commit upload', async () => {
|
|
716
|
+
const [conversationService, { apiClient, mlsService }] = await buildConversationService();
|
|
717
|
+
const mockGroupId = 'groupId-stale-add';
|
|
718
|
+
const mockConversationId = { id: PayloadHelper.getUUID(), domain: 'local.wire.com' };
|
|
719
|
+
const otherUsersToAdd = Array(2)
|
|
720
|
+
.fill(0)
|
|
721
|
+
.map(() => ({ id: PayloadHelper.getUUID(), domain: 'local.wire.com' }));
|
|
722
|
+
const qualifiedUsers = [...otherUsersToAdd];
|
|
723
|
+
const staleMessageError = {
|
|
724
|
+
type: core_crypto_1.ErrorType.Mls,
|
|
725
|
+
context: {
|
|
726
|
+
type: core_crypto_1.MlsErrorType.MessageRejected,
|
|
727
|
+
context: {
|
|
728
|
+
reason: (0, CoreCryptoMLSError_1.serializeAbortReason)({ message: CoreCryptoMLSError_1.UPLOAD_COMMIT_BUNDLE_ABORT_REASONS.MLS_STALE_MESSAGE }),
|
|
729
|
+
},
|
|
730
|
+
},
|
|
731
|
+
};
|
|
732
|
+
const getKPSpy = jest.spyOn(mlsService, 'getKeyPackagesPayload');
|
|
733
|
+
getKPSpy.mockResolvedValue({
|
|
734
|
+
keyPackages: [new Uint8Array(0)],
|
|
735
|
+
failures: [],
|
|
736
|
+
});
|
|
737
|
+
// Simulate commit upload failing once with stale, then succeeding
|
|
738
|
+
jest
|
|
739
|
+
.spyOn(mlsService, 'addUsersToExistingConversation')
|
|
740
|
+
.mockRejectedValueOnce(staleMessageError)
|
|
741
|
+
.mockResolvedValueOnce(undefined);
|
|
742
|
+
const remoteEpoch = 5;
|
|
743
|
+
const localEpoch = 4;
|
|
744
|
+
jest.spyOn(mlsService, 'conversationExists').mockResolvedValueOnce(true);
|
|
745
|
+
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
746
|
+
const getConvSpy = jest.spyOn(apiClient.api.conversation, 'getConversation');
|
|
747
|
+
getConvSpy.mockResolvedValue({
|
|
748
|
+
qualified_id: mockConversationId,
|
|
749
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
750
|
+
epoch: remoteEpoch,
|
|
751
|
+
group_id: mockGroupId,
|
|
752
|
+
});
|
|
753
|
+
await conversationService.addUsersToMLSConversation({
|
|
754
|
+
qualifiedUsers,
|
|
755
|
+
groupId: mockGroupId,
|
|
756
|
+
conversationId: mockConversationId,
|
|
757
|
+
});
|
|
758
|
+
expect(conversationService.joinByExternalCommit).toHaveBeenCalledWith(mockConversationId);
|
|
759
|
+
expect(mlsService.addUsersToExistingConversation).toHaveBeenCalledTimes(2);
|
|
760
|
+
});
|
|
602
761
|
});
|
|
603
762
|
describe('tryEstablishingMLSGroup', () => {
|
|
604
763
|
it('should add all the users to a MLS group after group was established by the self client', async () => {
|
|
@@ -656,7 +815,7 @@ describe('ConversationService', () => {
|
|
|
656
815
|
const groupId = 'group-1';
|
|
657
816
|
const qualified_id = { id: 'conv-1', domain: 'staging.zinfra.io' };
|
|
658
817
|
jest.spyOn(apiClient.api.conversation, 'getConversationList').mockResolvedValueOnce({
|
|
659
|
-
found: [{ group_id: groupId, qualified_id, protocol:
|
|
818
|
+
found: [{ group_id: groupId, qualified_id, protocol: team_1.CONVERSATION_PROTOCOL.MLS, epoch: 1 }],
|
|
660
819
|
});
|
|
661
820
|
const resetSpy = jest
|
|
662
821
|
.spyOn(conversationService, 'handleBrokenMLSConversation')
|
|
@@ -685,7 +844,7 @@ describe('ConversationService', () => {
|
|
|
685
844
|
{ id: 'u2', domain: 'staging.zinfra.io' },
|
|
686
845
|
];
|
|
687
846
|
jest.spyOn(apiClient.api.conversation, 'getConversationList').mockResolvedValueOnce({
|
|
688
|
-
found: [{ group_id: groupId, qualified_id, protocol:
|
|
847
|
+
found: [{ group_id: groupId, qualified_id, protocol: team_1.CONVERSATION_PROTOCOL.MLS, epoch: 1 }],
|
|
689
848
|
});
|
|
690
849
|
const addUsersSpy = jest
|
|
691
850
|
.spyOn(conversationService, 'addUsersToMLSConversation')
|
|
@@ -719,7 +878,7 @@ describe('ConversationService', () => {
|
|
|
719
878
|
const groupId = 'group-dup';
|
|
720
879
|
const qualified_id = { id: 'conv-dup', domain: 'staging.zinfra.io' };
|
|
721
880
|
jest.spyOn(apiClient.api.conversation, 'getConversationList').mockResolvedValue({
|
|
722
|
-
found: [{ group_id: groupId, qualified_id, protocol:
|
|
881
|
+
found: [{ group_id: groupId, qualified_id, protocol: team_1.CONVERSATION_PROTOCOL.MLS, epoch: 1 }],
|
|
723
882
|
});
|
|
724
883
|
// Make the recovery hang until we resolve it, to simulate overlapping calls
|
|
725
884
|
let resolveDeferred;
|
|
@@ -746,13 +905,45 @@ describe('ConversationService', () => {
|
|
|
746
905
|
await Promise.allSettled([p1, p2]);
|
|
747
906
|
expect(resetSpy).toHaveBeenCalledTimes(1);
|
|
748
907
|
});
|
|
908
|
+
it('handles stale-message by rejoining via external commit and emits recovery event', async () => {
|
|
909
|
+
const [conversationService, { apiClient, mlsService }] = await buildConversationService();
|
|
910
|
+
const groupId = 'group-stale';
|
|
911
|
+
const qualified_id = { id: 'conv-stale', domain: 'staging.zinfra.io' };
|
|
912
|
+
jest.spyOn(apiClient.api.conversation, 'getConversationList').mockResolvedValueOnce({
|
|
913
|
+
found: [{ group_id: groupId, qualified_id, protocol: team_1.CONVERSATION_PROTOCOL.MLS, epoch: 2 }],
|
|
914
|
+
});
|
|
915
|
+
const handler = getKeyMaterialFailureHandler(mlsService);
|
|
916
|
+
const staleMessageError = {
|
|
917
|
+
type: core_crypto_1.ErrorType.Mls,
|
|
918
|
+
context: {
|
|
919
|
+
type: core_crypto_1.MlsErrorType.MessageRejected,
|
|
920
|
+
context: {
|
|
921
|
+
reason: (0, CoreCryptoMLSError_1.serializeAbortReason)({ message: CoreCryptoMLSError_1.UPLOAD_COMMIT_BUNDLE_ABORT_REASONS.MLS_STALE_MESSAGE }),
|
|
922
|
+
},
|
|
923
|
+
},
|
|
924
|
+
};
|
|
925
|
+
const remoteEpoch = 3;
|
|
926
|
+
const localEpoch = 2;
|
|
927
|
+
jest.spyOn(mlsService, 'conversationExists').mockResolvedValueOnce(true);
|
|
928
|
+
jest.spyOn(mlsService, 'getEpoch').mockResolvedValueOnce(localEpoch);
|
|
929
|
+
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
930
|
+
qualified_id,
|
|
931
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
932
|
+
epoch: remoteEpoch,
|
|
933
|
+
group_id: groupId,
|
|
934
|
+
});
|
|
935
|
+
await handler({ error: staleMessageError, groupId });
|
|
936
|
+
// Expect a rejoin on stale and a recovery event
|
|
937
|
+
expect(conversationService.joinByExternalCommit).toHaveBeenCalledWith(qualified_id);
|
|
938
|
+
expect(conversationService.emit).toHaveBeenCalledWith('MLSConversationRecovered', { conversationId: qualified_id });
|
|
939
|
+
});
|
|
749
940
|
});
|
|
750
941
|
describe('groupIdConversationMap cache', () => {
|
|
751
942
|
function makeConversation(group_id, id) {
|
|
752
943
|
return {
|
|
753
944
|
group_id,
|
|
754
945
|
qualified_id: { id, domain: 'staging.zinfra.io' },
|
|
755
|
-
protocol:
|
|
946
|
+
protocol: team_1.CONVERSATION_PROTOCOL.MLS,
|
|
756
947
|
epoch: 1,
|
|
757
948
|
};
|
|
758
949
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { QualifiedUserClients,
|
|
1
|
+
import { QualifiedUserClients, MessageSendingStatus, Conversation } from '@wireapp/api-client/lib/conversation';
|
|
2
2
|
import { ConversationEvent, ConversationMemberJoinEvent } from '@wireapp/api-client/lib/event';
|
|
3
|
+
import { CONVERSATION_PROTOCOL } from '@wireapp/api-client/lib/team';
|
|
3
4
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
4
5
|
import { GenericMessage } from '@wireapp/protocol-messaging';
|
|
5
6
|
import { MessageSendingState } from '..';
|
|
@@ -48,7 +49,7 @@ export interface MessageSendingCallbacks {
|
|
|
48
49
|
* The protocol to use to send the message (MLS or Proteus)
|
|
49
50
|
*/
|
|
50
51
|
export type ProtocolParam = {
|
|
51
|
-
protocol:
|
|
52
|
+
protocol: CONVERSATION_PROTOCOL;
|
|
52
53
|
};
|
|
53
54
|
/**
|
|
54
55
|
* The message to send to the conversation
|
|
@@ -62,7 +63,7 @@ export type SendMlsMessageParams = SendCommonParams & {
|
|
|
62
63
|
* The groupId of the conversation to send the message to (Needed only for MLS)
|
|
63
64
|
*/
|
|
64
65
|
groupId: string;
|
|
65
|
-
protocol:
|
|
66
|
+
protocol: CONVERSATION_PROTOCOL.MLS;
|
|
66
67
|
};
|
|
67
68
|
export type KeyPackageClaimUser = QualifiedId & {
|
|
68
69
|
skipOwnClientId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.types.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"ConversationService.types.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,oBAAoB,EAAE,oBAAoB,EAAE,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAC9G,OAAO,EAAC,iBAAiB,EAAE,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAC,qBAAqB,EAAC,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAC,mBAAmB,EA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AE,mBAAmB,CAAC;IAC3B,4MAA4M;IAC5M,YAAY,CAAC,EAAE;QACb,gIAAgI;QAChI,MAAM,CAAC,EAAE,oBAAoB,GAAG,WAAW,EAAE,CAAC;QAC9C,oJAAoJ;QACpJ,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;KACxB,CAAC;CACH,CAAC"}
|
|
@@ -52,6 +52,7 @@ const event_1 = require("@wireapp/api-client/lib/event");
|
|
|
52
52
|
const protocol_messaging_1 = require("@wireapp/protocol-messaging");
|
|
53
53
|
const errors_1 = require("../../../errors");
|
|
54
54
|
const testUtils_1 = require("../../../testUtils");
|
|
55
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
55
56
|
jest.mock('./CryptoClient/CoreCryptoWrapper/PrekeysTracker', () => {
|
|
56
57
|
return {
|
|
57
58
|
PrekeyTracker: jest.fn().mockImplementation(() => {
|
|
@@ -346,7 +347,7 @@ describe('ProteusService', () => {
|
|
|
346
347
|
const params = {
|
|
347
348
|
conversationId: (0, testUtils_1.generateQualifiedId)('domain'),
|
|
348
349
|
payload: message,
|
|
349
|
-
protocol:
|
|
350
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
350
351
|
targetMode: conversation_2.MessageTargetMode.USERS,
|
|
351
352
|
};
|
|
352
353
|
try {
|
|
@@ -371,7 +372,7 @@ describe('ProteusService', () => {
|
|
|
371
372
|
MockedRecipients.getRecipientsForConversation.mockResolvedValue({});
|
|
372
373
|
jest.spyOn(proteusService['messageService'], 'sendMessage').mockReturnValue(Promise.resolve({}));
|
|
373
374
|
await proteusService.sendMessage({
|
|
374
|
-
protocol:
|
|
375
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
375
376
|
payload: message,
|
|
376
377
|
targetMode: conversation_2.MessageTargetMode.USERS,
|
|
377
378
|
userIds: recipients,
|
|
@@ -398,7 +399,7 @@ describe('ProteusService', () => {
|
|
|
398
399
|
MockedRecipients.getRecipientsForConversation.mockResolvedValue({});
|
|
399
400
|
jest.spyOn(proteusService['messageService'], 'sendMessage').mockResolvedValue({});
|
|
400
401
|
await proteusService.sendMessage({
|
|
401
|
-
protocol:
|
|
402
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
402
403
|
conversationId: { id: 'conv1', domain: 'domain1' },
|
|
403
404
|
payload: message,
|
|
404
405
|
targetMode: conversation_2.MessageTargetMode.USERS,
|
|
@@ -426,7 +427,7 @@ describe('ProteusService', () => {
|
|
|
426
427
|
jest.spyOn(proteusService['messageService'], 'sendMessage').mockReturnValue(Promise.resolve({}));
|
|
427
428
|
await proteusService.sendMessage({
|
|
428
429
|
conversationId: { id: 'conv1', domain: '' },
|
|
429
|
-
protocol:
|
|
430
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
430
431
|
payload: message,
|
|
431
432
|
targetMode: conversation_2.MessageTargetMode.USERS_CLIENTS,
|
|
432
433
|
userIds: recipients,
|
|
@@ -447,7 +448,7 @@ describe('ProteusService', () => {
|
|
|
447
448
|
MockedRecipients.getRecipientsForConversation.mockResolvedValue({});
|
|
448
449
|
jest.spyOn(proteusService['messageService'], 'sendMessage').mockReturnValue(Promise.resolve({}));
|
|
449
450
|
await proteusService.sendMessage({
|
|
450
|
-
protocol:
|
|
451
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
451
452
|
conversationId: { id: 'conv1', domain: 'domain1' },
|
|
452
453
|
payload: message,
|
|
453
454
|
targetMode: conversation_2.MessageTargetMode.USERS_CLIENTS,
|
|
@@ -473,7 +474,7 @@ describe('ProteusService', () => {
|
|
|
473
474
|
deleted: {},
|
|
474
475
|
});
|
|
475
476
|
const result = await proteusService.sendMessage({
|
|
476
|
-
protocol:
|
|
477
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
477
478
|
conversationId: (0, testUtils_1.generateQualifiedId)('domain'),
|
|
478
479
|
payload: message,
|
|
479
480
|
targetMode: conversation_2.MessageTargetMode.USERS_CLIENTS,
|
|
@@ -575,7 +576,7 @@ describe('ProteusService', () => {
|
|
|
575
576
|
status_time: '',
|
|
576
577
|
},
|
|
577
578
|
},
|
|
578
|
-
protocol:
|
|
579
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
579
580
|
};
|
|
580
581
|
it('adds all requested users to a new conversation', async () => {
|
|
581
582
|
const [proteusService, { apiClient }] = await (0, ProteusService_mocks_1.buildProteusService)();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { QualifiedUserClients, MessageSendingStatus,
|
|
1
|
+
import { QualifiedUserClients, MessageSendingStatus, NewConversation } from '@wireapp/api-client/lib/conversation';
|
|
2
|
+
import { CONVERSATION_PROTOCOL } from '@wireapp/api-client/lib/team';
|
|
2
3
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
3
4
|
import { AddUsersParams, MessageSendingOptions, SendCommonParams } from '../../../conversation';
|
|
4
5
|
export interface NewClient {
|
|
@@ -17,7 +18,7 @@ export type SendProteusMessageParams = SendCommonParams & MessageSendingOptions
|
|
|
17
18
|
*/
|
|
18
19
|
userIds?: QualifiedId[] | QualifiedUserClients;
|
|
19
20
|
onClientMismatch?: (status: MessageSendingStatus, wasSent: boolean) => void | boolean | Promise<boolean>;
|
|
20
|
-
protocol:
|
|
21
|
+
protocol: CONVERSATION_PROTOCOL.PROTEUS;
|
|
21
22
|
};
|
|
22
23
|
export type CreateProteusConversationParams = {
|
|
23
24
|
conversationData: NewConversation | string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProteusService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"ProteusService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/ProteusService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,oBAAoB,EAAE,oBAAoB,EAAE,eAAe,EAAC,MAAM,sCAAsC,CAAC;AACjH,OAAO,EAAC,qBAAqB,EAAC,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,cAAc,EAAE,qBAAqB,EAAE,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAE9F,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;CACrB;AACD,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GACrD,qBAAqB,GAAG;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC;IAC/C,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzG,QAAQ,EAAE,qBAAqB,CAAC,OAAO,CAAC;CACzC,CAAC;AAEJ,MAAM,MAAM,+BAA+B,GAAG;IAC5C,gBAAgB,EAAE,eAAe,GAAG,MAAM,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -44,10 +44,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
44
44
|
/* eslint-disable import/order */
|
|
45
45
|
const GenericMessageParams = __importStar(require("../Utility/getGenericMessageParams"));
|
|
46
46
|
const client_1 = require("@wireapp/api-client/lib/client");
|
|
47
|
-
const conversation_1 = require("
|
|
48
|
-
const conversation_2 = require("../../../conversation");
|
|
47
|
+
const conversation_1 = require("../../../conversation");
|
|
49
48
|
const MessageBuilder_1 = require("../../../conversation/message/MessageBuilder");
|
|
50
49
|
const ProteusService_mocks_1 = require("./ProteusService.mocks");
|
|
50
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
51
51
|
jest.mock('../Utility/getGenericMessageParams', () => {
|
|
52
52
|
return {
|
|
53
53
|
getGenericMessageParams: jest.fn(),
|
|
@@ -89,9 +89,9 @@ describe('sendGenericMessage', () => {
|
|
|
89
89
|
const payloadBundle = await proteusService.sendMessage({
|
|
90
90
|
payload: message,
|
|
91
91
|
conversationId: { id: 'conv1', domain: '' },
|
|
92
|
-
protocol:
|
|
92
|
+
protocol: team_1.CONVERSATION_PROTOCOL.PROTEUS,
|
|
93
93
|
});
|
|
94
|
-
expect(payloadBundle.state).toBe(
|
|
94
|
+
expect(payloadBundle.state).toBe(conversation_1.MessageSendingState.CANCELED);
|
|
95
95
|
});
|
|
96
96
|
});
|
|
97
97
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConversationProtocol } from '@wireapp/api-client/lib/conversation';
|
|
2
1
|
import { Self } from '@wireapp/api-client/lib/self/';
|
|
2
|
+
import { CONVERSATION_PROTOCOL } from '@wireapp/api-client/lib/team';
|
|
3
3
|
import { APIClient } from '@wireapp/api-client';
|
|
4
4
|
export declare class SelfService {
|
|
5
5
|
private readonly apiClient;
|
|
@@ -16,6 +16,6 @@ export declare class SelfService {
|
|
|
16
16
|
* Update self user's list of supported-protocols
|
|
17
17
|
* @param supportedProtocols The list of supported protocols
|
|
18
18
|
*/
|
|
19
|
-
putSupportedProtocols(supportedProtocols:
|
|
19
|
+
putSupportedProtocols(supportedProtocols: CONVERSATION_PROTOCOL[]): Promise<void>;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=SelfService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelfService.d.ts","sourceRoot":"","sources":["../../src/self/SelfService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"SelfService.d.ts","sourceRoot":"","sources":["../../src/self/SelfService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,IAAI,EAAC,MAAM,+BAA+B,CAAC;AACnD,OAAO,EAAC,qBAAqB,EAAC,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAG9C,qBAAa,WAAW;IAGV,OAAO,CAAC,QAAQ,CAAC,SAAS;IAFtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqD;gBAE/C,SAAS,EAAE,SAAS;IAEpC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKvD,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAMhD,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAK1B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxB,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAKhD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD;;;OAGG;IACU,qBAAqB,CAAC,kBAAkB,EAAE,qBAAqB,EAAE;CAY/E"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
const
|
|
21
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
22
22
|
const api_client_1 = require("@wireapp/api-client");
|
|
23
23
|
const SelfService_1 = require("./SelfService");
|
|
24
24
|
const BASE_URL = 'mock-backend.wire.com';
|
|
@@ -33,7 +33,7 @@ describe('SelfService', () => {
|
|
|
33
33
|
apiClient.backendFeatures.supportsMLS = true;
|
|
34
34
|
it('updates the list of self supported protocols', async () => {
|
|
35
35
|
const selfService = new SelfService_1.SelfService(apiClient);
|
|
36
|
-
const supportedProtocols = [
|
|
36
|
+
const supportedProtocols = [team_1.CONVERSATION_PROTOCOL.PROTEUS, team_1.CONVERSATION_PROTOCOL.MLS];
|
|
37
37
|
jest.spyOn(apiClient.api.self, 'putSupportedProtocols').mockImplementation(jest.fn());
|
|
38
38
|
await selfService.putSupportedProtocols(supportedProtocols);
|
|
39
39
|
expect(apiClient.api.self.putSupportedProtocols).toHaveBeenCalledWith(supportedProtocols);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CONVERSATION_PROTOCOL } from '@wireapp/api-client/lib/team';
|
|
2
2
|
import { QualifiedId, User } from '@wireapp/api-client/lib/user/';
|
|
3
3
|
import { APIClient } from '@wireapp/api-client';
|
|
4
4
|
export declare class UserService {
|
|
@@ -13,6 +13,6 @@ export declare class UserService {
|
|
|
13
13
|
/**
|
|
14
14
|
* Get the list of other user's supported protocols.
|
|
15
15
|
*/
|
|
16
|
-
getUserSupportedProtocols(userId: QualifiedId): Promise<
|
|
16
|
+
getUserSupportedProtocols(userId: QualifiedId): Promise<CONVERSATION_PROTOCOL[]>;
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=UserService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../src/user/UserService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../src/user/UserService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,qBAAqB,EAAC,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAC,WAAW,EAAE,IAAI,EAAC,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAE1B,SAAS,EAAE,SAAS;IAIzB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE;;;;;IAO5C;;OAEG;IACU,yBAAyB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;CAS9F"}
|
package/lib/user/UserService.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.UserService = void 0;
|
|
22
|
-
const
|
|
22
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
23
23
|
class UserService {
|
|
24
24
|
apiClient;
|
|
25
25
|
constructor(apiClient) {
|
|
@@ -40,10 +40,10 @@ class UserService {
|
|
|
40
40
|
async getUserSupportedProtocols(userId) {
|
|
41
41
|
// Clients that uses version below the one supporting MLS, are not aware of user's supported protocols, we default to Proteus in this case.
|
|
42
42
|
if (!this.apiClient.backendFeatures.supportsMLS) {
|
|
43
|
-
return [
|
|
43
|
+
return [team_1.CONVERSATION_PROTOCOL.PROTEUS];
|
|
44
44
|
}
|
|
45
45
|
const supportedProtocols = await this.apiClient.api.user.getUserSupportedProtocols(userId);
|
|
46
|
-
return supportedProtocols.length > 0 ? supportedProtocols : [
|
|
46
|
+
return supportedProtocols.length > 0 ? supportedProtocols : [team_1.CONVERSATION_PROTOCOL.PROTEUS];
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
exports.UserService = UserService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypePredicateUtil.d.ts","sourceRoot":"","sources":["../../src/util/TypePredicateUtil.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"TypePredicateUtil.d.ts","sourceRoot":"","sources":["../../src/util/TypePredicateUtil.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,WAAW,EAAC,MAAM,uCAAuC,CAAC;AAEvH,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAE1D,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,MAAM,EAAE,CAEvD;AAMD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,WAAW,EAAE,CAEjE;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,oBAAoB,CAS5E;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,WAAW,CAM1D;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,YAAY,IAAI,eAAe,CAG7F"}
|
|
@@ -23,7 +23,7 @@ exports.isQualifiedIdArray = isQualifiedIdArray;
|
|
|
23
23
|
exports.isQualifiedUserClients = isQualifiedUserClients;
|
|
24
24
|
exports.isUserClients = isUserClients;
|
|
25
25
|
exports.isMLSConversation = isMLSConversation;
|
|
26
|
-
const
|
|
26
|
+
const team_1 = require("@wireapp/api-client/lib/team");
|
|
27
27
|
function isStringArray(obj) {
|
|
28
28
|
return Array.isArray(obj) && (obj.length === 0 || typeof obj[0] === 'string');
|
|
29
29
|
}
|
|
@@ -52,5 +52,5 @@ function isUserClients(obj) {
|
|
|
52
52
|
}
|
|
53
53
|
function isMLSConversation(conversation) {
|
|
54
54
|
const { protocol, epoch, group_id } = conversation;
|
|
55
|
-
return protocol ===
|
|
55
|
+
return protocol === team_1.CONVERSATION_PROTOCOL.MLS && epoch !== undefined && group_id !== undefined;
|
|
56
56
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@wireapp/api-client": "^27.
|
|
14
|
+
"@wireapp/api-client": "^27.87.0",
|
|
15
15
|
"@wireapp/commons": "^5.4.9",
|
|
16
16
|
"@wireapp/core-crypto": "9.1.0",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"test:coverage": "jest --coverage",
|
|
62
62
|
"watch": "tsc --watch"
|
|
63
63
|
},
|
|
64
|
-
"version": "46.
|
|
65
|
-
"gitHead": "
|
|
64
|
+
"version": "46.45.0",
|
|
65
|
+
"gitHead": "031bc333d66a0228a3475dc0a10b5c3685784132"
|
|
66
66
|
}
|