diff --git a/keyserver/src/socket/socket.js b/keyserver/src/socket/socket.js --- a/keyserver/src/socket/socket.js +++ b/keyserver/src/socket/socket.js @@ -77,6 +77,7 @@ fetchViewerForSocket, extendCookieLifespan, createNewAnonymousCookie, + isCookieMissingSignedIdentityKeysBlob, } from '../session/cookies.js'; import { Viewer } from '../session/viewer.js'; import { commitSessionUpdate } from '../updaters/session-updaters.js'; @@ -466,6 +467,9 @@ serverRequests.push({ type: serverRequestTypes.PLATFORM_DETAILS }); } + const isCookieMissingSignedIdentityKeysBlobPromise = + isCookieMissingSignedIdentityKeysBlob(viewer.cookieID); + if (!sessionInitializationResult.sessionContinued) { const [threadsResult, entriesResult, currentUserInfo, knownUserInfos] = await Promise.all([ @@ -542,6 +546,15 @@ }); } + const signedIdentityKeysBlobMissing = + await isCookieMissingSignedIdentityKeysBlobPromise; + + if (signedIdentityKeysBlobMissing) { + serverRequests.push({ + type: serverRequestTypes.SIGNED_IDENTITY_KEYS_BLOB, + }); + } + if (serverRequests.length > 0 || clientResponses.length > 0) { // We send this message first since the STATE_SYNC triggers the client's // connection status to shift to "connected", and we want to make sure the