@wireapp/core 29.1.5 → 29.2.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [29.2.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@29.1.7...@wireapp/core@29.2.0) (2022-08-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Upgrade @otak/core-crypto from 0.3.0-beta-2 to 0.3.0 ([#4360](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/issues/4360)) ([87035a2](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/87035a28856a28f32484791e193f8018ef69fd24))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [29.1.7](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@29.1.6...@wireapp/core@29.1.7) (2022-08-11)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @wireapp/core
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [29.1.6](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@29.1.5...@wireapp/core@29.1.6) (2022-08-11)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @wireapp/core
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [29.1.5](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@29.1.4...@wireapp/core@29.1.5) (2022-08-10)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @wireapp/core
|
package/package.json
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
},
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@open-wc/webpack-import-meta-loader": "0.4.7",
|
|
7
|
-
"@otak/core-crypto": "0.3.0-
|
|
7
|
+
"@otak/core-crypto": "0.3.0-es2017",
|
|
8
8
|
"@types/long": "4.0.1",
|
|
9
9
|
"@types/node": "~14",
|
|
10
|
-
"@wireapp/api-client": "19.21.
|
|
10
|
+
"@wireapp/api-client": "19.21.2",
|
|
11
11
|
"@wireapp/commons": "4.3.0",
|
|
12
12
|
"@wireapp/cryptobox": "12.8.0",
|
|
13
13
|
"@wireapp/store-engine-dexie": "1.6.10",
|
|
@@ -77,6 +77,6 @@
|
|
|
77
77
|
"test:node": "nyc jasmine --config=jasmine.json",
|
|
78
78
|
"watch": "tsc ---watch"
|
|
79
79
|
},
|
|
80
|
-
"version": "29.
|
|
81
|
-
"gitHead": "
|
|
80
|
+
"version": "29.2.0",
|
|
81
|
+
"gitHead": "7531f172591eda76341bee9dc2cdedca57f84a35"
|
|
82
82
|
}
|
|
@@ -824,8 +824,10 @@ class ConversationService {
|
|
|
824
824
|
if (memberAddedMessages === null || memberAddedMessages === void 0 ? void 0 : memberAddedMessages.welcome) {
|
|
825
825
|
await this.apiClient.api.conversation.postMlsWelcomeMessage(Uint8Array.from(memberAddedMessages.welcome));
|
|
826
826
|
}
|
|
827
|
-
if (memberAddedMessages === null || memberAddedMessages === void 0 ? void 0 : memberAddedMessages.
|
|
828
|
-
|
|
827
|
+
if (memberAddedMessages === null || memberAddedMessages === void 0 ? void 0 : memberAddedMessages.commit) {
|
|
828
|
+
const messageResponse = await this.apiClient.api.conversation.postMlsMessage(Uint8Array.from(memberAddedMessages.commit));
|
|
829
|
+
await coreCryptoClient.commitAccepted(groupIdDecodedFromBase64);
|
|
830
|
+
return messageResponse;
|
|
829
831
|
}
|
|
830
832
|
return null;
|
|
831
833
|
}
|
|
@@ -211,12 +211,11 @@ class NotificationService extends events_1.EventEmitter {
|
|
|
211
211
|
async handleEvent(event, source, dryRun = false) {
|
|
212
212
|
var _a;
|
|
213
213
|
const coreCryptoClient = this.coreCryptoClientProvider();
|
|
214
|
+
if (!coreCryptoClient) {
|
|
215
|
+
throw new Error('Unable to access core crypto client');
|
|
216
|
+
}
|
|
214
217
|
switch (event.type) {
|
|
215
218
|
case Events.CONVERSATION_EVENT.MLS_WELCOME_MESSAGE:
|
|
216
|
-
if (!coreCryptoClient) {
|
|
217
|
-
// TODO throw proper error
|
|
218
|
-
throw new Error('TODO');
|
|
219
|
-
}
|
|
220
219
|
const data = bazinga64_1.Decoder.fromBase64(event.data).asBytes;
|
|
221
220
|
// We extract the groupId from the welcome message and let coreCrypto store this group
|
|
222
221
|
const newGroupId = await coreCryptoClient.processWelcomeMessage(data);
|
|
@@ -227,18 +226,17 @@ class NotificationService extends events_1.EventEmitter {
|
|
|
227
226
|
mappedEvent: ConversationMapper_1.ConversationMapper.mapConversationEvent(Object.assign(Object.assign({}, event), { data: groupIdStr }), source),
|
|
228
227
|
};
|
|
229
228
|
case Events.CONVERSATION_EVENT.MLS_MESSAGE_ADD:
|
|
230
|
-
if (!coreCryptoClient) {
|
|
231
|
-
// TODO throw proper error
|
|
232
|
-
throw new Error('TODO');
|
|
233
|
-
}
|
|
234
229
|
const encryptedData = bazinga64_1.Decoder.fromBase64(event.data).asBytes;
|
|
235
230
|
const groupId = await this.getUint8ArrayFromConversationGroupId(event.qualified_conversation || { id: event.conversation, domain: '' });
|
|
236
231
|
const rawData = await coreCryptoClient.decryptMessage(groupId, encryptedData);
|
|
237
|
-
if (!rawData) {
|
|
238
|
-
|
|
239
|
-
throw new Error('empty message');
|
|
232
|
+
if (!rawData.message) {
|
|
233
|
+
throw new Error(`MLS message received from ${source} was empty`);
|
|
240
234
|
}
|
|
241
|
-
const decryptedData = protocol_messaging_1.GenericMessage.decode(rawData);
|
|
235
|
+
const decryptedData = protocol_messaging_1.GenericMessage.decode(rawData.message);
|
|
236
|
+
/**
|
|
237
|
+
* @todo Find a proper solution to add mappedEvent to this return
|
|
238
|
+
* otherwise event.data will be base64 raw data of the received event
|
|
239
|
+
*/
|
|
242
240
|
return { event, decryptedData };
|
|
243
241
|
// Encrypted Proteus events
|
|
244
242
|
case Events.CONVERSATION_EVENT.OTR_MESSAGE_ADD: {
|