diff --git a/keyserver/src/responders/redux-state-responders.js b/keyserver/src/responders/redux-state-responders.js --- a/keyserver/src/responders/redux-state-responders.js +++ b/keyserver/src/responders/redux-state-responders.js @@ -30,7 +30,7 @@ import { webNavInfoValidator } from 'lib/types/nav-types.js'; import type { WebInitialKeyserverInfo, - WebInitialReduxStateResponse, + ServerWebInitialReduxStateResponse, } from 'lib/types/redux-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; @@ -86,8 +86,8 @@ threadInfos: t.dict(tID, mixedRawThreadInfoValidator), }); -export const initialReduxStateValidator: TInterface = - tShape({ +export const initialReduxStateValidator: TInterface = + tShape({ navInfo: webNavInfoValidator, currentUserInfo: currentUserInfoValidator, entryStore: entryStoreValidator, @@ -103,7 +103,7 @@ async function getInitialReduxStateResponder( viewer: Viewer, request: InitialReduxStateRequest, -): Promise { +): Promise { const { urlInfo, excludedData, clientUpdatesCurrentAsOf } = request; const useDatabase = viewer.loggedIn && canUseDatabaseOnWeb(viewer.userID); @@ -356,18 +356,19 @@ }; })(); - const initialReduxState: WebInitialReduxStateResponse = await promiseAll({ - navInfo: navInfoPromise, - currentUserInfo: currentUserInfoPromise, - entryStore: entryStorePromise, - threadStore: threadStorePromise, - userInfos: userInfosPromise, - messageStore: messageStorePromise, - pushApiPublicKey: pushApiPublicKeyPromise, - commServicesAccessToken: null, - inviteLinksStore: inviteLinksStorePromise, - keyserverInfo: keyserverInfoPromise, - }); + const initialReduxState: ServerWebInitialReduxStateResponse = + await promiseAll({ + navInfo: navInfoPromise, + currentUserInfo: currentUserInfoPromise, + entryStore: entryStorePromise, + threadStore: threadStorePromise, + userInfos: userInfosPromise, + messageStore: messageStorePromise, + pushApiPublicKey: pushApiPublicKeyPromise, + commServicesAccessToken: null, + inviteLinksStore: inviteLinksStorePromise, + keyserverInfo: keyserverInfoPromise, + }); return initialReduxState; } diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -165,7 +165,19 @@ }; export type AppState = NativeAppState | WebAppState; -export type WebInitialReduxStateResponse = { +export type ClientWebInitialReduxStateResponse = { + +navInfo: WebNavInfo, + +currentUserInfo: CurrentUserInfo, + +entryStore: EntryStore, + +threadStore: ThreadStore, + +userInfos: UserInfos, + +messageStore: MessageStore, + +pushApiPublicKey: ?string, + +commServicesAccessToken: null, + +inviteLinksStore: InviteLinksStore, + +keyserverInfo: WebInitialKeyserverInfo, +}; +export type ServerWebInitialReduxStateResponse = { +navInfo: WebNavInfo, +currentUserInfo: CurrentUserInfo, +entryStore: EntryStore, diff --git a/web/redux/action-types.js b/web/redux/action-types.js --- a/web/redux/action-types.js +++ b/web/redux/action-types.js @@ -5,7 +5,7 @@ import { defaultCalendarFilters } from 'lib/types/filter-types.js'; import type { WebInitialKeyserverInfo, - WebInitialReduxStateResponse, + ClientWebInitialReduxStateResponse, } from 'lib/types/redux-types.js'; import { useKeyserverCall } from 'lib/utils/keyserver-call.js'; import type { URLInfo } from 'lib/utils/url-utils.js'; @@ -76,7 +76,7 @@ } } - const responses: { +[string]: WebInitialReduxStateResponse } = + const responses: { +[string]: ClientWebInitialReduxStateResponse } = await callKeyserverEndpoint( 'get_initial_redux_state', requests,