Page MenuHomePhabricator

D7860.id26634.diff
No OneTemporary

D7860.id26634.diff

diff --git a/keyserver/src/socket/session-utils.js b/keyserver/src/socket/session-utils.js
--- a/keyserver/src/socket/session-utils.js
+++ b/keyserver/src/socket/session-utils.js
@@ -41,6 +41,7 @@
tPlatformDetails,
} from 'lib/utils/validation-utils.js';
+import { createOlmSession } from '../creators/olm-session-creator.js';
import { saveOneTimeKeys } from '../creators/one-time-keys-creator.js';
import createReport from '../creators/report-creator.js';
import { SQL } from '../database/database.js';
@@ -131,6 +132,13 @@
),
signedIdentityKeysBlob: signedIdentityKeysBlobValidator,
}),
+ tShape({
+ type: t.irreducible(
+ 'serverRequestTypes.INITIAL_NOTIFICATIONS_ENCRYPTED_MESSAGE',
+ x => x === serverRequestTypes.INITIAL_NOTIFICATIONS_ENCRYPTED_MESSAGE,
+ ),
+ initialNotificationsEncryptedMessage: t.String,
+ }),
]);
type StateCheckStatus =
@@ -230,6 +238,24 @@
} catch (e) {
continue;
}
+ } else if (
+ clientResponse.type ===
+ serverRequestTypes.INITIAL_NOTIFICATIONS_ENCRYPTED_MESSAGE
+ ) {
+ invariant(
+ clientResponse.initialNotificationsEncryptedMessage,
+ 'initialNotificationsEncryptedMessage expected in client response',
+ );
+ const { initialNotificationsEncryptedMessage } = clientResponse;
+ try {
+ await createOlmSession(
+ initialNotificationsEncryptedMessage,
+ 'notifications',
+ viewer.cookieID,
+ );
+ } catch (e) {
+ continue;
+ }
}
}

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 2, 11:19 PM (18 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609246
Default Alt Text
D7860.id26634.diff (1 KB)

Event Timeline