Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3383773
D11375.id38291.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
D11375.id38291.diff
View Options
diff --git a/keyserver/src/socket/tunnelbroker-socket.js b/keyserver/src/socket/tunnelbroker-socket.js
--- a/keyserver/src/socket/tunnelbroker-socket.js
+++ b/keyserver/src/socket/tunnelbroker-socket.js
@@ -33,6 +33,7 @@
connected: boolean;
promises: Promises;
heartbeatTimeoutID: ?TimeoutID;
+ oneTimeKeysPromise: ?Promise<void>;
constructor(socketURL: string, initMessage: ConnectionInitializationMessage) {
this.connected = false;
@@ -108,7 +109,7 @@
const messageToKeyserver = JSON.parse(payload);
if (refreshKeysRequestValidator.is(messageToKeyserver)) {
const request: RefreshKeyRequest = messageToKeyserver;
- await uploadNewOneTimeKeys(request.numberOfKeys);
+ this.refreshOneTimeKeys(request.numberOfKeys);
}
} catch (e) {
console.error(
@@ -150,6 +151,14 @@
}
};
+ refreshOneTimeKeys: (numberOfKeys: number) => void = numberOfKeys => {
+ const oldOneTimeKeysPromise = this.oneTimeKeysPromise;
+ this.oneTimeKeysPromise = (async () => {
+ await oldOneTimeKeysPromise;
+ await uploadNewOneTimeKeys(numberOfKeys);
+ })();
+ };
+
sendMessage: (message: ClientMessageToDevice) => Promise<void> = (
message: ClientMessageToDevice,
) => {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 5:41 PM (20 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2597663
Default Alt Text
D11375.id38291.diff (1 KB)
Attached To
Mode
D11375: [keyserver] Make keyserver handle one-time key refresh requests sequentially
Attached
Detach File
Event Timeline
Log In to Comment