diff --git a/lib/reducers/keyserver-reducer.test.js b/lib/reducers/keyserver-reducer.test.js --- a/lib/reducers/keyserver-reducer.test.js +++ b/lib/reducers/keyserver-reducer.test.js @@ -2,7 +2,10 @@ import reduceKeyserverStore from './keyserver-reducer.js'; import { deleteKeyserverAccountActionTypes } from '../actions/user-actions.js'; -import { defaultKeyserverInfo } from '../types/keyserver-types.js'; +import { + defaultKeyserverInfo, + type KeyserverStore, +} from '../types/keyserver-types.js'; import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js'; jest.mock('../utils/config.js'); @@ -44,17 +47,17 @@ }); it('update keyserverInfo with authoritativeKeyserverID', () => { const defaultAshoatKeyserverInfo = defaultKeyserverInfo('url1'); - const oldKeyserverStore = { + const oldKeyserverStore: KeyserverStore = ({ keyserverInfos: { [authoritativeKeyserverID()]: { ...defaultAshoatKeyserverInfo, connection: { ...defaultAshoatKeyserverInfo.connection, - connectionIssue: 'not_logged_in_error', + connectionIssue: 'blah', }, }, }, - }; + }: any); const deleteAccountAction = { type: deleteKeyserverAccountActionTypes.success, @@ -85,17 +88,17 @@ it('return the same keyserverInfo with authoritativeKeyserverID()', () => { const defaultAshoatKeyserverInfo = defaultKeyserverInfo('url1'); - const oldKeyserverStore = { + const oldKeyserverStore: KeyserverStore = ({ keyserverInfos: { [authoritativeKeyserverID()]: { ...defaultAshoatKeyserverInfo, connection: { ...defaultAshoatKeyserverInfo.connection, - connectionIssue: 'not_logged_in_error', + connectionIssue: 'blah', }, }, }, - }; + }: any); const deleteAccountAction = { type: deleteKeyserverAccountActionTypes.success, @@ -121,6 +124,6 @@ reduceKeyserverStore(oldKeyserverStore, deleteAccountAction) .keyserverStore.keyserverInfos[authoritativeKeyserverID()].connection .connectionIssue, - ).toEqual('not_logged_in_error'); + ).toEqual('blah'); }); }); 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 @@ -16,7 +16,6 @@ import { updateLastCommunicatedPlatformDetailsActionType } from '../actions/device-actions.js'; import { setNewSessionActionType, - setConnectionIssueActionType, updateConnectionStatusActionType, setLateResponseActionType, setActiveSessionRecoveryActionType, @@ -689,10 +688,10 @@ ) { if (e.message === 'not_logged_in') { this.props.dispatch({ - type: setConnectionIssueActionType, + type: setActiveSessionRecoveryActionType, payload: { + activeSessionRecovery: recoveryActionSources.socketNotLoggedIn, keyserverID: this.props.keyserverID, - connectionIssue: 'not_logged_in_error', }, }); } else if (this.socket) { diff --git a/lib/types/account-types.js b/lib/types/account-types.js --- a/lib/types/account-types.js +++ b/lib/types/account-types.js @@ -106,6 +106,7 @@ sqliteLoadFailure: 'SQLITE_LOAD_FAILURE', corruptedDatabaseDeletion: 'CORRUPTED_DATABASE_DELETION', refetchUserDataAfterAcknowledgment: 'REFETCH_USER_DATA_AFTER_ACKNOWLEDGMENT', + socketNotLoggedIn: 'SOCKET_NOT_LOGGED_IN', }); export type RecoveryActionSource = $Values; 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 @@ -493,7 +493,7 @@ | 'forcedDisconnecting' | 'disconnected'; -export type ConnectionIssue = 'not_logged_in_error'; +export type ConnectionIssue = empty; export type ConnectionInfo = { +status: ConnectionStatus, @@ -518,7 +518,7 @@ queuedActivityUpdates: t.list(activityUpdateValidator), lateResponses: t.list(t.Number), unreachable: t.Boolean, - connectionIssue: t.maybe(t.enums.of(['not_logged_in_error'])), + connectionIssue: t.maybe(t.enums.of([])), activeSessionRecovery: t.maybe(t.enums.of(values(recoveryActionSources))), }); export const defaultConnectionInfo: ConnectionInfo = {