Page MenuHomePhabricator

D7860.id27192.diff
No OneTemporary

D7860.id27192.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(
+ t.String.is(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:10 PM (18 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608862
Default Alt Text
D7860.id27192.diff (1 KB)

Event Timeline