@wireapp/core 46.46.4 → 46.46.5-beta.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.
@@ -454,6 +454,23 @@ describe('MLSService', () => {
454
454
  jest.advanceTimersByTime(commitDelay);
455
455
  expect(transactionContext.decryptMessage).toHaveBeenCalled();
456
456
  });
457
+ it('Throws if decryption fails', async () => {
458
+ const [mlsService, { transactionContext }] = await createMLSService();
459
+ const getGroupIdFromConversationId = () => Promise.resolve(mockGroupId);
460
+ jest
461
+ .spyOn(transactionContext, 'decryptMessage')
462
+ .mockRejectedValueOnce(new Error(CoreCryptoMLSError_1.CORE_CRYPTO_ERROR_NAMES.MlsErrorWrongEpoch));
463
+ const mockedMLSMessageAddEvent = {
464
+ type: event_1.CONVERSATION_EVENT.MLS_MESSAGE_ADD,
465
+ senderClientId: '',
466
+ conversation: '',
467
+ data: mockedMLSWelcomeEventData,
468
+ from: '',
469
+ time: '',
470
+ };
471
+ await expect(mlsService.handleMLSMessageAddEvent(mockedMLSMessageAddEvent, getGroupIdFromConversationId)).rejects.toThrow(CoreCryptoMLSError_1.CORE_CRYPTO_ERROR_NAMES.MlsErrorWrongEpoch);
472
+ expect(transactionContext.decryptMessage).toHaveBeenCalled();
473
+ });
457
474
  });
458
475
  describe('handleMLSWelcomeMessageEvent', () => {
459
476
  it("before processing welcome it verifies that there's enough key packages locally", async () => {
package/package.json CHANGED
@@ -61,6 +61,6 @@
61
61
  "test:coverage": "jest --coverage",
62
62
  "watch": "tsc --watch"
63
63
  },
64
- "version": "46.46.4",
65
- "gitHead": "ff5b8e2b92e2dca441b28ec37108c8c7be309c7c"
64
+ "version": "46.46.5-beta.0",
65
+ "gitHead": "1dd286dc69dd2f1bc1e08541a391e22c512cf0c0"
66
66
  }