Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2833296
D12443.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12443.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12443: [keyserver] move mark_prekey_as_published calls inside of publishPrekeysToIdentity
Attached
Detach File
Event Timeline
Log In to Comment