diff --git a/lib/hooks/keyserver-reachability.js b/lib/hooks/keyserver-reachability.js --- a/lib/hooks/keyserver-reachability.js +++ b/lib/hooks/keyserver-reachability.js @@ -3,11 +3,9 @@ import invariant from 'invariant'; import * as React from 'react'; +import { updateKeyserverReachabilityActionType } from '../keyserver-conn/keyserver-conn-types.js'; import { connectionSelector } from '../selectors/keyserver-selectors.js'; -import { - updateKeyserverReachabilityActionType, - type ConnectionStatus, -} from '../types/socket-types.js'; +import type { ConnectionStatus } from '../types/socket-types.js'; import { useSelector, useDispatch } from '../utils/redux-utils.js'; import { ashoatKeyserverID } from '../utils/validation-utils.js'; diff --git a/lib/keyserver-conn/keyserver-conn-types.js b/lib/keyserver-conn/keyserver-conn-types.js --- a/lib/keyserver-conn/keyserver-conn-types.js +++ b/lib/keyserver-conn/keyserver-conn-types.js @@ -11,6 +11,7 @@ ClientSessionChange, PreRequestUserState, } from '../types/session-types.js'; +import type { ConnectionStatus } from '../types/socket-types.js'; import type { CallSingleKeyserverEndpoint, CallSingleKeyserverEndpointOptions, @@ -70,4 +71,26 @@ allKeyserverIDs: $ReadOnlyArray, ) => Args => Promise; +export const setConnectionIssueActionType = 'SET_CONNECTION_ISSUE'; + +export const updateConnectionStatusActionType = 'UPDATE_CONNECTION_STATUS'; +export type UpdateConnectionStatusPayload = { + +status: ConnectionStatus, + +keyserverID: string, +}; + +export const setLateResponseActionType = 'SET_LATE_RESPONSE'; +export type SetLateResponsePayload = { + +messageID: number, + +isLate: boolean, + +keyserverID: string, +}; + +export const updateKeyserverReachabilityActionType = + 'UPDATE_KEYSERVER_REACHABILITY'; +export type UpdateKeyserverReachabilityPayload = { + +visible: boolean, + +keyserverID: string, +}; + export { setNewSessionActionType, setNewSession }; diff --git a/lib/reducers/keyserver-reducer.js b/lib/reducers/keyserver-reducer.js --- a/lib/reducers/keyserver-reducer.js +++ b/lib/reducers/keyserver-reducer.js @@ -20,7 +20,13 @@ logInActionTypes, resetUserStateActionType, } from '../actions/user-actions.js'; -import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; +import { + setNewSessionActionType, + updateConnectionStatusActionType, + setLateResponseActionType, + updateKeyserverReachabilityActionType, + setConnectionIssueActionType, +} from '../keyserver-conn/keyserver-conn-types.js'; import { keyserverStoreOpsHandlers, type ReplaceKeyserverOperation, @@ -33,10 +39,6 @@ import { fullStateSyncActionType, incrementalStateSyncActionType, - updateConnectionStatusActionType, - setLateResponseActionType, - updateKeyserverReachabilityActionType, - setConnectionIssueActionType, } from '../types/socket-types.js'; import { updateTypes } from '../types/update-types-enum.js'; import { processUpdatesActionType } from '../types/update-types.js'; diff --git a/lib/socket/socket.react.js b/lib/socket/socket.react.js --- a/lib/socket/socket.react.js +++ b/lib/socket/socket.react.js @@ -15,7 +15,12 @@ import UpdateHandler from './update-handler.react.js'; import { updateActivityActionTypes } from '../actions/activity-actions.js'; import { updateLastCommunicatedPlatformDetailsActionType } from '../actions/device-actions.js'; -import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; +import { + setNewSessionActionType, + setConnectionIssueActionType, + updateConnectionStatusActionType, + setLateResponseActionType, +} from '../keyserver-conn/keyserver-conn-types.js'; import { resolveKeyserverSessionInvalidation } from '../keyserver-conn/recovery-utils.js'; import { unsupervisedBackgroundActionType } from '../reducers/lifecycle-state-reducer.js'; import type { InitialNotifMessageOptions } from '../shared/crypto-utils.js'; @@ -42,7 +47,6 @@ type PreRequestUserState, } from '../types/session-types.js'; import { - setConnectionIssueActionType, clientSocketMessageTypes, type ClientClientSocketMessage, serverSocketMessageTypes, @@ -50,7 +54,6 @@ stateSyncPayloadTypes, fullStateSyncActionType, incrementalStateSyncActionType, - updateConnectionStatusActionType, type ConnectionInfo, type ClientInitialClientSocketMessage, type ClientResponsesClientSocketMessage, @@ -60,7 +63,6 @@ type ClientSocketMessageWithoutID, type SocketListener, type ConnectionStatus, - setLateResponseActionType, type CommTransportLayer, type ActivityUpdateResponseServerSocketMessage, type ClientStateSyncServerSocketMessage, 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 @@ -104,9 +104,6 @@ ConnectionIssue, StateSyncFullActionPayload, StateSyncIncrementalActionPayload, - UpdateConnectionStatusPayload, - SetLateResponsePayload, - UpdateKeyserverReachabilityPayload, } from './socket-types.js'; import { type ClientStore } from './store-ops-types.js'; import type { SubscriptionUpdateResult } from './subscription-types.js'; @@ -126,6 +123,11 @@ import type { ClientUpdatesResultWithUserInfos } from './update-types.js'; import type { CurrentUserInfo, UserInfos, UserStore } from './user-types.js'; import type { SetDeviceTokenActionPayload } from '../actions/device-actions.js'; +import type { + UpdateConnectionStatusPayload, + SetLateResponsePayload, + UpdateKeyserverReachabilityPayload, +} from '../keyserver-conn/keyserver-conn-types.js'; import type { NotifPermissionAlertInfo } from '../utils/push-alerts.js'; export type BaseAppState = { diff --git a/lib/types/socket-types.js b/lib/types/socket-types.js --- a/lib/types/socket-types.js +++ b/lib/types/socket-types.js @@ -532,28 +532,6 @@ sessionRecoveryInProgress: false, }; -export const setConnectionIssueActionType = 'SET_CONNECTION_ISSUE'; - -export const updateConnectionStatusActionType = 'UPDATE_CONNECTION_STATUS'; -export type UpdateConnectionStatusPayload = { - +status: ConnectionStatus, - +keyserverID: string, -}; - -export const setLateResponseActionType = 'SET_LATE_RESPONSE'; -export type SetLateResponsePayload = { - +messageID: number, - +isLate: boolean, - +keyserverID: string, -}; - -export const updateKeyserverReachabilityActionType = - 'UPDATE_KEYSERVER_REACHABILITY'; -export type UpdateKeyserverReachabilityPayload = { - +visible: boolean, - +keyserverID: string, -}; - export type OneTimeKeyGenerator = (inc: number) => string; export type GRPCStream = { diff --git a/native/socket.react.js b/native/socket.react.js --- a/native/socket.react.js +++ b/native/socket.react.js @@ -3,6 +3,7 @@ import invariant from 'invariant'; import * as React from 'react'; +import { setConnectionIssueActionType } from 'lib/keyserver-conn/keyserver-conn-types.js'; import { resolveKeyserverSessionInvalidation } from 'lib/keyserver-conn/recovery-utils.js'; import { preRequestUserStateForSingleKeyserverSelector } from 'lib/selectors/account-selectors.js'; import { @@ -17,7 +18,6 @@ import { useInitialNotificationsEncryptedMessage } from 'lib/shared/crypto-utils.js'; import Socket, { type BaseSocketProps } from 'lib/socket/socket.react.js'; import { logInActionSources } from 'lib/types/account-types.js'; -import { setConnectionIssueActionType } from 'lib/types/socket-types.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';