diff --git a/lib/types/crypto-types.js b/lib/types/crypto-types.js --- a/lib/types/crypto-types.js +++ b/lib/types/crypto-types.js @@ -42,6 +42,7 @@ cookie: ?string, notificationsIdentityKeys: OLMIdentityKeys, notificationsInitializationInfo: OlmSessionInitializationInfo, + keyserverID: string, ) => Promise, }; diff --git a/web/account/account-hooks.js b/web/account/account-hooks.js --- a/web/account/account-hooks.js +++ b/web/account/account-hooks.js @@ -186,6 +186,7 @@ cookie: ?string, notificationsIdentityKeys: OLMIdentityKeys, notificationsInitializationInfo: OlmSessionInitializationInfo, + keyserverID: string, ) => { const [{ notificationAccount }, encryptionKey] = await Promise.all([ getOrCreateCryptoStore(), @@ -231,7 +232,10 @@ const notifsOlmDataEncryptionKeyDBLabel = getOlmEncryptionKeyDBLabelForCookie(cookie); - const notifsOlmDataContentKey = getOlmDataContentKeyForCookie(cookie); + const notifsOlmDataContentKey = getOlmDataContentKeyForCookie( + cookie, + keyserverID, + ); const persistEncryptionKeyPromise = (async () => { let cryptoKeyPersistentForm; @@ -265,6 +269,7 @@ cookie: ?string, notificationsIdentityKeys: OLMIdentityKeys, notificationsInitializationInfo: OlmSessionInitializationInfo, + keyserverID: string, ) => { if (notificationsSessionPromise.current) { return notificationsSessionPromise.current; @@ -276,6 +281,7 @@ cookie, notificationsIdentityKeys, notificationsInitializationInfo, + keyserverID, ); } catch (e) { notificationsSessionPromise.current = undefined; @@ -314,6 +320,7 @@ cookie: ?string, notificationsIdentityKeys: OLMIdentityKeys, notificationsInitializationInfo: OlmSessionInitializationInfo, + keyserverID: string, ) => Promise { const context = React.useContext(WebNotificationsSessionCreatorContext); invariant(context, 'WebNotificationsSessionCreator not found.'); diff --git a/web/push-notif/notif-crypto-utils.js b/web/push-notif/notif-crypto-utils.js --- a/web/push-notif/notif-crypto-utils.js +++ b/web/push-notif/notif-crypto-utils.js @@ -330,7 +330,11 @@ return olmDBKeys; } -function getOlmDataContentKeyForCookie(cookie: ?string): string { +function getOlmDataContentKeyForCookie( + cookie: ?string, + // eslint-disable-next-line no-unused-vars + keyserverID: string, +): string { if (!cookie) { return NOTIFICATIONS_OLM_DATA_CONTENT; } diff --git a/web/socket.react.js b/web/socket.react.js --- a/web/socket.react.js +++ b/web/socket.react.js @@ -68,6 +68,7 @@ cookie, notificationsIdentityKeys, notificationsInitializationInfo, + ashoatKeyserverID, ), [webNotificationsSessionCreator, cookie], );