@wireapp/core 30.7.1 → 30.8.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,25 @@
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
+ # [30.8.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@30.7.2...@wireapp/core@30.8.0) (2022-09-14)
7
+
8
+
9
+ ### Features
10
+
11
+ * Call clearPendingCommits when commit sending failed on backend ([#4395](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/issues/4395)) ([b863bf0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/b863bf0b3292bb71db94eb6411e5232e5918646e))
12
+
13
+
14
+
15
+
16
+
17
+ ## [30.7.2](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@30.7.1...@wireapp/core@30.7.2) (2022-09-14)
18
+
19
+ **Note:** Version bump only for package @wireapp/core
20
+
21
+
22
+
23
+
24
+
6
25
  ## [30.7.1](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@30.7.0...@wireapp/core@30.7.1) (2022-09-14)
7
26
 
8
27
 
package/package.json CHANGED
@@ -77,6 +77,6 @@
77
77
  "test:node": "nyc jasmine --config=jasmine.json",
78
78
  "watch": "tsc ---watch"
79
79
  },
80
- "version": "30.7.1",
81
- "gitHead": "35d2172b1f840bcdf77cd3b40d93cae2e0d0556d"
80
+ "version": "30.8.0",
81
+ "gitHead": "908930586bdf08bdb150a1092084ab36f80fbb64"
82
82
  }
@@ -144,12 +144,14 @@ class Account extends events_1.EventEmitter {
144
144
  // Assumption: client gets only initialized once
145
145
  if (initClient) {
146
146
  await this.initClient({ clientType });
147
- // initialize schedulers for pending mls proposals once client is initialized
148
- await ((_a = this.service) === null || _a === void 0 ? void 0 : _a.notification.checkExistingPendingProposals());
149
- // initialize schedulers for renewing key materials
150
- await ((_b = this.service) === null || _b === void 0 ? void 0 : _b.notification.checkForKeyMaterialsUpdate());
151
- // initialize scheduler for syncing key packages with backend
152
- await ((_c = this.service) === null || _c === void 0 ? void 0 : _c.notification.checkForKeyPackagesBackendSync());
147
+ if (this.mlsConfig) {
148
+ // initialize schedulers for pending mls proposals once client is initialized
149
+ await ((_a = this.service) === null || _a === void 0 ? void 0 : _a.notification.checkExistingPendingProposals());
150
+ // initialize schedulers for renewing key materials
151
+ await ((_b = this.service) === null || _b === void 0 ? void 0 : _b.notification.checkForKeyMaterialsUpdate());
152
+ // initialize scheduler for syncing key packages with backend
153
+ await ((_c = this.service) === null || _c === void 0 ? void 0 : _c.notification.checkForKeyPackagesBackendSync());
154
+ }
153
155
  }
154
156
  return context;
155
157
  }
@@ -1,4 +1,4 @@
1
- import { AddProposalArgs, CommitBundle, ConversationConfiguration, ConversationId, CoreCrypto, DecryptedMessage, ExternalProposalArgs, ExternalProposalType, ExternalRemoveProposalArgs, Invitee, ProposalArgs, ProposalType, RemoveProposalArgs } from '@wireapp/core-crypto/platforms/web/corecrypto';
1
+ import { AddProposalArgs, CommitBundle, ConversationConfiguration, ConversationId, CoreCrypto, DecryptedMessage, ExternalProposalArgs, ExternalProposalType, ExternalRemoveProposalArgs, Invitee, ProposalArgs, ProposalType, RemoveProposalArgs } from '@wireapp/core-crypto';
2
2
  import { APIClient } from '@wireapp/api-client';
3
3
  import { QualifiedUsers } from '../../conversation';
4
4
  import type { MLSConfig } from '../types';
@@ -11,9 +11,9 @@ export declare class MLSService {
11
11
  constructor(config: MLSConfig | undefined, apiClient: APIClient, coreCryptoClientProvider: () => CoreCrypto | undefined);
12
12
  private getCoreCryptoClient;
13
13
  private uploadCommitBundle;
14
- addUsersToExistingConversation(groupIdDecodedFromBase64: Uint8Array, invitee: Invitee[]): Promise<PostMlsMessageResponse | null>;
14
+ addUsersToExistingConversation(groupId: Uint8Array, invitee: Invitee[]): Promise<PostMlsMessageResponse | null>;
15
15
  getKeyPackagesPayload(qualifiedUsers: QualifiedUsers[]): Promise<Invitee[]>;
16
- newProposal(proposalType: ProposalType, args: ProposalArgs | AddProposalArgs | RemoveProposalArgs): Promise<import("@wireapp/core-crypto/platforms/web/corecrypto").ProposalBundle>;
16
+ newProposal(proposalType: ProposalType, args: ProposalArgs | AddProposalArgs | RemoveProposalArgs): Promise<import("@wireapp/core-crypto").ProposalBundle>;
17
17
  newExternalProposal(externalProposalType: ExternalProposalType, args: ExternalProposalArgs | ExternalRemoveProposalArgs): Promise<Uint8Array>;
18
18
  processWelcomeMessage(welcomeMessage: Uint8Array): Promise<ConversationId>;
19
19
  decryptMessage(conversationId: ConversationId, payload: Uint8Array): Promise<DecryptedMessage>;
@@ -39,36 +39,31 @@ class MLSService {
39
39
  }
40
40
  return client;
41
41
  }
42
- async uploadCommitBundle(groupIdDecodedFromBase64, commitBundle) {
42
+ async uploadCommitBundle(groupId, commitBundle) {
43
43
  const coreCryptoClient = this.getCoreCryptoClient();
44
44
  if (commitBundle.welcome) {
45
45
  //@todo: it's temporary - we wait for core-crypto fix to return the actual Uint8Array instead of regular array
46
46
  await this.apiClient.api.conversation.postMlsWelcomeMessage((0, exports.optionalToUint8Array)(commitBundle.welcome));
47
47
  }
48
48
  if (commitBundle.commit) {
49
- const messageResponse = await this.apiClient.api.conversation.postMlsMessage(
50
- //@todo: it's temporary - we wait for core-crypto fix to return the actual Uint8Array instead of regular array
51
- (0, exports.optionalToUint8Array)(commitBundle.commit));
52
- await coreCryptoClient.commitAccepted(groupIdDecodedFromBase64);
53
- return messageResponse;
49
+ try {
50
+ const messageResponse = await this.apiClient.api.conversation.postMlsMessage(
51
+ //@todo: it's temporary - we wait for core-crypto fix to return the actual Uint8Array instead of regular array
52
+ (0, exports.optionalToUint8Array)(commitBundle.commit));
53
+ await coreCryptoClient.commitAccepted(groupId);
54
+ return messageResponse;
55
+ }
56
+ catch (error) {
57
+ await coreCryptoClient.clear_pending_commit(groupId);
58
+ return null;
59
+ }
54
60
  }
55
61
  return null;
56
62
  }
57
- async addUsersToExistingConversation(groupIdDecodedFromBase64, invitee) {
63
+ async addUsersToExistingConversation(groupId, invitee) {
58
64
  const coreCryptoClient = this.getCoreCryptoClient();
59
- const memberAddedMessages = await coreCryptoClient.addClientsToConversation(groupIdDecodedFromBase64, invitee);
60
- if (memberAddedMessages === null || memberAddedMessages === void 0 ? void 0 : memberAddedMessages.welcome) {
61
- //@todo: it's temporary - we wait for core-crypto fix to return the actual Uint8Array instead of regular array
62
- await this.apiClient.api.conversation.postMlsWelcomeMessage((0, exports.optionalToUint8Array)(memberAddedMessages.welcome));
63
- }
64
- if (memberAddedMessages === null || memberAddedMessages === void 0 ? void 0 : memberAddedMessages.commit) {
65
- const messageResponse = await this.apiClient.api.conversation.postMlsMessage(
66
- //@todo: it's temporary - we wait for core-crypto fix to return the actual Uint8Array instead of regular array
67
- (0, exports.optionalToUint8Array)(memberAddedMessages.commit));
68
- await coreCryptoClient.commitAccepted(groupIdDecodedFromBase64);
69
- return messageResponse;
70
- }
71
- return null;
65
+ const memberAddedMessages = await coreCryptoClient.addClientsToConversation(groupId, invitee);
66
+ return this.uploadCommitBundle(groupId, memberAddedMessages);
72
67
  }
73
68
  async getKeyPackagesPayload(qualifiedUsers) {
74
69
  /**