diff --git a/web/avatars/avatar-hooks.react.js b/web/avatars/avatar-hooks.react.js --- a/web/avatars/avatar-hooks.react.js +++ b/web/avatars/avatar-hooks.react.js @@ -8,8 +8,8 @@ } from 'lib/actions/upload-actions.js'; import type { UpdateUserAvatarRequest } from 'lib/types/avatar-types.js'; import { useLegacyAshoatKeyserverCall } from 'lib/utils/action-utils.js'; -import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; +import { authoritativeKeyserverID } from '../authoritative-keyserver.js'; import { encryptFile } from '../media/encryption-utils.js'; import { generateThumbHash } from '../media/image-utils.js'; import { validateFile } from '../media/media-utils.js'; @@ -68,7 +68,7 @@ loop: false, thumbHash, }, - keyserverOrThreadID: ashoatKeyserverID, + keyserverOrThreadID: authoritativeKeyserverID, callbacks: {}, }); diff --git a/web/calendar/entry.react.js b/web/calendar/entry.react.js --- a/web/calendar/entry.react.js +++ b/web/calendar/entry.react.js @@ -45,9 +45,9 @@ type DispatchActionPromise, } from 'lib/utils/redux-promise-utils.js'; import { useDispatch } from 'lib/utils/redux-utils.js'; -import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; import css from './calendar.css'; +import { authoritativeKeyserverID } from '../authoritative-keyserver.js'; import LoadingIndicator from '../loading-indicator.react.js'; import LogInFirstModal from '../modals/account/log-in-first-modal.react.js'; import ConcurrentModificationModal from '../modals/concurrent-modification-modal.react.js'; @@ -472,7 +472,9 @@ !!(state.currentUserInfo && !state.currentUserInfo.anonymous && true), ); const calendarQuery = useSelector(nonThreadCalendarQuery); - const connection = useSelector(connectionSelector(ashoatKeyserverID)); + const connection = useSelector( + connectionSelector(authoritativeKeyserverID), + ); invariant(connection, 'keyserver missing from keyserverStore'); const online = connection.status === 'connected'; const callCreateEntry = useCreateEntry(); diff --git a/web/push-notif/badge-handler.react.js b/web/push-notif/badge-handler.react.js --- a/web/push-notif/badge-handler.react.js +++ b/web/push-notif/badge-handler.react.js @@ -5,14 +5,14 @@ import { connectionSelector } from 'lib/selectors/keyserver-selectors.js'; import { unreadCount } from 'lib/selectors/thread-selectors.js'; import type { ConnectionInfo } from 'lib/types/socket-types.js'; -import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; +import { authoritativeKeyserverID } from '../authoritative-keyserver.js'; import electron from '../electron.js'; import { useSelector } from '../redux/redux-utils.js'; import getTitle from '../title/getTitle.js'; function useBadgeHandler() { - const connection = useSelector(connectionSelector(ashoatKeyserverID)); + const connection = useSelector(connectionSelector(authoritativeKeyserverID)); const prevConnection = React.useRef(); const boundUnreadCount = useSelector(unreadCount); diff --git a/web/push-notif/push-notifs-handler.js b/web/push-notif/push-notifs-handler.js --- a/web/push-notif/push-notifs-handler.js +++ b/web/push-notif/push-notifs-handler.js @@ -15,9 +15,9 @@ } from 'lib/utils/push-alerts.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import { useDispatch } from 'lib/utils/redux-utils.js'; -import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; import { decryptDesktopNotification } from './notif-crypto-utils.js'; +import { authoritativeKeyserverID } from '../authoritative-keyserver.js'; import { WORKERS_MODULES_DIR_PATH, DEFAULT_OLM_FILENAME, @@ -73,7 +73,7 @@ ({ threadID }: { +threadID: string }) => { const convertedThreadID = convertNonPendingIDToNewSchema( threadID, - ashoatKeyserverID, + authoritativeKeyserverID, ); const payload = { diff --git a/web/push-notif/service-worker.js b/web/push-notif/service-worker.js --- a/web/push-notif/service-worker.js +++ b/web/push-notif/service-worker.js @@ -7,7 +7,6 @@ WebNotification, } from 'lib/types/notif-types.js'; import { convertNonPendingIDToNewSchema } from 'lib/utils/migration-utils.js'; -import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; import { decryptWebNotification, @@ -15,6 +14,7 @@ type WebNotifsServiceUtilsData, type WebNotifDecryptionError, } from './notif-crypto-utils.js'; +import { authoritativeKeyserverID } from '../authoritative-keyserver.js'; import { localforageConfig } from '../database/utils/constants.js'; declare class PushMessageData { @@ -150,7 +150,7 @@ if (!event.notification.data.isError) { threadID = convertNonPendingIDToNewSchema( event.notification.data.threadID, - ashoatKeyserverID, + authoritativeKeyserverID, ); } 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 @@ -9,8 +9,8 @@ } from 'lib/types/redux-types.js'; import { useKeyserverCall } from 'lib/utils/keyserver-call.js'; import type { URLInfo } from 'lib/utils/url-utils.js'; -import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; +import { authoritativeKeyserverID } from '../authoritative-keyserver.js'; import type { ExcludedData, InitialReduxState, @@ -54,7 +54,7 @@ // for adding a new keyserver more extensive. However, for the time being // we need to add this check below so that we aren't trying to make calls // to nonexistant keyservers that are in our keyserver store. - if (keyserverID !== ashoatKeyserverID) { + if (keyserverID !== authoritativeKeyserverID) { continue; } const clientUpdatesCurrentAsOf = allUpdatesCurrentAsOf[keyserverID]; @@ -89,7 +89,7 @@ pushApiPublicKey, commServicesAccessToken, navInfo, - } = responses[ashoatKeyserverID]; + } = responses[authoritativeKeyserverID]; const dataLoaded = currentUserInfo && !currentUserInfo.anonymous; const actualizedCalendarQuery = { diff --git a/web/redux/default-state.js b/web/redux/default-state.js --- a/web/redux/default-state.js +++ b/web/redux/default-state.js @@ -5,9 +5,9 @@ import { defaultKeyserverInfo } from 'lib/types/keyserver-types.js'; import { defaultGlobalThemeInfo } from 'lib/types/theme-types.js'; import { defaultNotifPermissionAlertInfo } from 'lib/utils/push-alerts.js'; -import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; import type { AppState } from './redux-setup.js'; +import { authoritativeKeyserverID } from '../authoritative-keyserver.js'; declare var keyserverURL: string; @@ -35,7 +35,7 @@ messages: {}, threads: {}, local: {}, - currentAsOf: { [ashoatKeyserverID]: 0 }, + currentAsOf: { [authoritativeKeyserverID]: 0 }, }, windowActive: true, pushApiPublicKey: null, @@ -71,7 +71,7 @@ communityPickerStore: { chat: null, calendar: null }, keyserverStore: { keyserverInfos: { - [ashoatKeyserverID]: defaultKeyserverInfo(keyserverURL), + [authoritativeKeyserverID]: defaultKeyserverInfo(keyserverURL), }, }, threadActivityStore: {}, diff --git a/web/redux/initial-state-gate.js b/web/redux/initial-state-gate.js --- a/web/redux/initial-state-gate.js +++ b/web/redux/initial-state-gate.js @@ -14,13 +14,13 @@ import { entries } from 'lib/utils/objects.js'; import { useDispatch } from 'lib/utils/redux-utils.js'; import { infoFromURL } from 'lib/utils/url-utils.js'; -import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; import { setInitialReduxState, useGetInitialReduxState, } from './action-types.js'; import { useSelector } from './redux-utils.js'; +import { authoritativeKeyserverID } from '../authoritative-keyserver.js'; import { getClientDBStore, processDBStoreOperations, @@ -59,7 +59,10 @@ if (urlInfo.thread) { urlInfo = { ...urlInfo, - thread: convertIDToNewSchema(urlInfo.thread, ashoatKeyserverID), + thread: convertIDToNewSchema( + urlInfo.thread, + authoritativeKeyserverID, + ), }; } const clientDBStore = await getClientDBStore(); diff --git a/web/redux/persist.js b/web/redux/persist.js --- a/web/redux/persist.js +++ b/web/redux/persist.js @@ -28,12 +28,12 @@ } from 'lib/utils/migration-utils.js'; import { entries } from 'lib/utils/objects.js'; import { resetUserSpecificState } from 'lib/utils/reducers-utils.js'; -import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; import commReduxStorageEngine from './comm-redux-storage-engine.js'; import { defaultWebState } from './default-state.js'; import type { AppState } from './redux-setup.js'; import { nonUserSpecificFieldsWeb } from './redux-setup.js'; +import { authoritativeKeyserverID } from '../authoritative-keyserver.js'; import { getDatabaseModule } from '../database/database-module-provider.js'; import { isSQLiteSupported } from '../database/utils/db-utils.js'; import { workerRequestMessageTypes } from '../types/worker-types.js'; @@ -124,8 +124,8 @@ ...keyserverStore, keyserverInfos: { ...keyserverStore.keyserverInfos, - [ashoatKeyserverID]: { - ...keyserverStore.keyserverInfos[ashoatKeyserverID], + [authoritativeKeyserverID]: { + ...keyserverStore.keyserverInfos[authoritativeKeyserverID], lastCommunicatedPlatformDetails, }, }, @@ -183,8 +183,8 @@ ...state.keyserverStore, keyserverInfos: { ...state.keyserverStore.keyserverInfos, - [ashoatKeyserverID]: { - ...state.keyserverStore.keyserverInfos[ashoatKeyserverID], + [authoritativeKeyserverID]: { + ...state.keyserverStore.keyserverInfos[authoritativeKeyserverID], cookie, }, }, @@ -201,8 +201,8 @@ ...state.keyserverStore, keyserverInfos: { ...state.keyserverStore.keyserverInfos, - [ashoatKeyserverID]: { - ...state.keyserverStore.keyserverInfos[ashoatKeyserverID], + [authoritativeKeyserverID]: { + ...state.keyserverStore.keyserverInfos[authoritativeKeyserverID], urlPrefix: keyserverURL, }, },