Page MenuHomePhabricator

D12443.diff
No OneTemporary

D12443.diff

diff --git a/keyserver/src/utils/olm-utils.js b/keyserver/src/utils/olm-utils.js
--- a/keyserver/src/utils/olm-utils.js
+++ b/keyserver/src/utils/olm-utils.js
@@ -249,28 +249,24 @@
return JSON.parse(accountInfo.account.identity_keys()).ed25519;
}
-async function validateAndUploadAccountPrekeys(
+function validateAndUploadAccountPrekeys(
contentAccount: OlmAccount,
notifAccount: OlmAccount,
): Promise<void> {
if (contentAccount.unpublished_prekey()) {
- await publishPrekeysToIdentity(contentAccount, notifAccount);
- contentAccount.mark_prekey_as_published();
- notifAccount.mark_prekey_as_published();
- return;
+ return publishPrekeysToIdentity(contentAccount, notifAccount);
}
// Since keys are rotated synchronously, only check validity of one
if (shouldRotatePrekey(contentAccount)) {
contentAccount.generate_prekey();
notifAccount.generate_prekey();
- await publishPrekeysToIdentity(contentAccount, notifAccount);
- contentAccount.mark_prekey_as_published();
- notifAccount.mark_prekey_as_published();
+ return publishPrekeysToIdentity(contentAccount, notifAccount);
}
if (shouldForgetPrekey(contentAccount)) {
contentAccount.forget_old_prekey();
notifAccount.forget_old_prekey();
}
+ return Promise.resolve();
}
async function publishPrekeysToIdentity(
@@ -312,6 +308,9 @@
notifPrekey,
notifPrekeySignature,
);
+
+ contentAccount.mark_prekey_as_published();
+ notifAccount.mark_prekey_as_published();
}
export {

File Metadata

Mime Type
text/plain
Expires
Sun, Sep 29, 7:52 AM (22 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2199491
Default Alt Text
D12443.diff (1 KB)

Event Timeline