@wireapp/core 46.39.1 → 46.39.2
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/conversation/ConversationService/ConversationService.d.ts.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.js +2 -1
- package/lib/conversation/ConversationService/ConversationService.test.js +4 -1
- package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.d.ts +0 -2
- package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.js +1 -6
- package/package.json +2 -2
|
@@ -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,EAEpB,mBAAmB,EAEnB,eAAe,EACf,kBAAkB,EAGnB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,YAAY,EAIZ,4BAA4B,EAE7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,GAAG,EAAC,MAAM,oCAAoC,CAAC;AAGvD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAa,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAI/D,OAAO,EACL,cAAc,EACd,8BAA8B,EAE9B,oBAAoB,EACpB,UAAU,EACX,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAC,YAAY,EAAuB,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.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AO,CAAC,IAAI,CAAC;YAkCH,wBAAwB;YAsBxB,gCAAgC;YAyBhC,4BAA4B;YA6B5B,wBAAwB;YAIxB,yBAAyB;IAKvC;;;;OAIG;IACU,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAoB3E"}
|
|
@@ -631,7 +631,8 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
631
631
|
}
|
|
632
632
|
catch (error) {
|
|
633
633
|
this.logger.warn('Failed to handle MLS welcome message event', { event, error });
|
|
634
|
-
if ((0,
|
|
634
|
+
if ((0, core_crypto_1.isMlsOrphanWelcomeError)(error)) {
|
|
635
|
+
this.logger.warn('Received an orphan welcome message, trying to join the conversation via external commit');
|
|
635
636
|
const { qualified_conversation: conversationId } = event;
|
|
636
637
|
// Note that we don't care about a subconversation here, as the welcome message is always for the parent conversation.
|
|
637
638
|
// Subconversations are always joined via external commit.
|
|
@@ -47,6 +47,7 @@ const event_1 = require("@wireapp/api-client/lib/event");
|
|
|
47
47
|
const http_1 = require("@wireapp/api-client/lib/http");
|
|
48
48
|
const http_status_codes_1 = require("http-status-codes");
|
|
49
49
|
const api_client_1 = require("@wireapp/api-client");
|
|
50
|
+
const core_crypto_1 = require("@wireapp/core-crypto");
|
|
50
51
|
const __1 = require("..");
|
|
51
52
|
const CoreCryptoMLSError_1 = require("../../messagingProtocols/mls/MLSService/CoreCryptoMLSError");
|
|
52
53
|
const MessagingProtocols = __importStar(require("../../messagingProtocols/proteus"));
|
|
@@ -438,7 +439,9 @@ describe('ConversationService', () => {
|
|
|
438
439
|
const conversationId = { id: 'conversationId', domain: 'staging.zinfra.io' };
|
|
439
440
|
const mockMLSWelcomeMessageEvent = createMLSWelcomeMessageEventMock(conversationId);
|
|
440
441
|
const orphanWelcomeMessageError = new Error();
|
|
441
|
-
orphanWelcomeMessageError.name =
|
|
442
|
+
orphanWelcomeMessageError.name = core_crypto_1.MlsErrorType.OrphanWelcome;
|
|
443
|
+
orphanWelcomeMessageError.context = { type: core_crypto_1.MlsErrorType.OrphanWelcome };
|
|
444
|
+
orphanWelcomeMessageError.type = core_crypto_1.ErrorType.Mls;
|
|
442
445
|
jest.spyOn(mlsService, 'handleMLSWelcomeMessageEvent').mockRejectedValueOnce(orphanWelcomeMessageError);
|
|
443
446
|
jest.spyOn(apiClient.api.conversation, 'getConversation').mockResolvedValueOnce({
|
|
444
447
|
qualified_id: conversationId,
|
|
@@ -11,10 +11,8 @@ export declare const CORE_CRYPTO_ERROR_NAMES: {
|
|
|
11
11
|
ProteusErrorSessionNotFound: string;
|
|
12
12
|
ProteusErrorRemoteIdentityChanged: string;
|
|
13
13
|
MlsErrorWrongEpoch: string;
|
|
14
|
-
MlsErrorOrphanWelcomeMessage: string;
|
|
15
14
|
};
|
|
16
15
|
export declare const isCoreCryptoMLSWrongEpochError: (error: unknown) => boolean;
|
|
17
16
|
export declare const isCoreCryptoMLSConversationAlreadyExistsError: (error: unknown) => boolean;
|
|
18
|
-
export declare const isCoreCryptoMLSOrphanWelcomeMessageError: (error: unknown) => boolean;
|
|
19
17
|
export declare const shouldMLSDecryptionErrorBeIgnored: (error: unknown) => error is Error;
|
|
20
18
|
//# sourceMappingURL=CoreCryptoMLSError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreCryptoMLSError.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/CoreCryptoMLSError.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"CoreCryptoMLSError.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/CoreCryptoMLSError.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;CAanC,CAAC;AAEF,eAAO,MAAM,8BAA8B,UAAW,OAAO,KAAG,OAE/D,CAAC;AAEF,eAAO,MAAM,6CAA6C,UAAW,OAAO,KAAG,OAE9E,CAAC;AAoBF,eAAO,MAAM,iCAAiC,UAAW,OAAO,KAAG,KAAK,IAAI,KAI3E,CAAC"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.shouldMLSDecryptionErrorBeIgnored = exports.
|
|
21
|
+
exports.shouldMLSDecryptionErrorBeIgnored = exports.isCoreCryptoMLSConversationAlreadyExistsError = exports.isCoreCryptoMLSWrongEpochError = exports.CORE_CRYPTO_ERROR_NAMES = void 0;
|
|
22
22
|
exports.CORE_CRYPTO_ERROR_NAMES = {
|
|
23
23
|
MlsErrorConversationAlreadyExists: 'MlsErrorConversationAlreadyExists',
|
|
24
24
|
MlsErrorDuplicateMessage: 'MlsErrorDuplicateMessage',
|
|
@@ -32,7 +32,6 @@ exports.CORE_CRYPTO_ERROR_NAMES = {
|
|
|
32
32
|
ProteusErrorSessionNotFound: 'ProteusErrorSessionNotFound',
|
|
33
33
|
ProteusErrorRemoteIdentityChanged: 'ProteusErrorRemoteIdentityChanged',
|
|
34
34
|
MlsErrorWrongEpoch: 'MlsErrorWrongEpoch',
|
|
35
|
-
MlsErrorOrphanWelcomeMessage: 'MlsErrorOrphanWelcomeMessage',
|
|
36
35
|
};
|
|
37
36
|
const isCoreCryptoMLSWrongEpochError = (error) => {
|
|
38
37
|
return error instanceof Error && error.name === exports.CORE_CRYPTO_ERROR_NAMES.MlsErrorWrongEpoch;
|
|
@@ -42,10 +41,6 @@ const isCoreCryptoMLSConversationAlreadyExistsError = (error) => {
|
|
|
42
41
|
return error instanceof Error && error.name === exports.CORE_CRYPTO_ERROR_NAMES.MlsErrorConversationAlreadyExists;
|
|
43
42
|
};
|
|
44
43
|
exports.isCoreCryptoMLSConversationAlreadyExistsError = isCoreCryptoMLSConversationAlreadyExistsError;
|
|
45
|
-
const isCoreCryptoMLSOrphanWelcomeMessageError = (error) => {
|
|
46
|
-
return error instanceof Error && error.name === exports.CORE_CRYPTO_ERROR_NAMES.MlsErrorOrphanWelcomeMessage;
|
|
47
|
-
};
|
|
48
|
-
exports.isCoreCryptoMLSOrphanWelcomeMessageError = isCoreCryptoMLSOrphanWelcomeMessageError;
|
|
49
44
|
const mlsDecryptionErrorNamesToIgnore = [
|
|
50
45
|
exports.CORE_CRYPTO_ERROR_NAMES.MlsErrorStaleCommit,
|
|
51
46
|
exports.CORE_CRYPTO_ERROR_NAMES.MlsErrorStaleProposal,
|
package/package.json
CHANGED