diff --git a/keyserver/src/responders/website-responders.js b/keyserver/src/responders/website-responders.js --- a/keyserver/src/responders/website-responders.js +++ b/keyserver/src/responders/website-responders.js @@ -203,23 +203,6 @@ 'default notifPermissionAlertInfo', _isEqual(defaultNotifPermissionAlertInfo), ), - connection: tShape({ - status: tString('connecting'), - queuedActivityUpdates: t.irreducible( - 'default queuedActivityUpdates', - _isEqual([]), - ), - actualizedCalendarQuery: tShape({ - startDate: t.String, - endDate: t.String, - filters: t.irreducible( - 'default filters', - _isEqual(defaultCalendarFilters), - ), - }), - lateResponses: t.irreducible('default lateResponses', _isEqual([])), - showDisconnectedBar: tBool(false), - }), watchedThreadIDs: t.irreducible('default watchedThreadIDs', _isEqual([])), lifecycleState: tString('active'), enabledApps: t.irreducible( @@ -604,7 +587,6 @@ communityPickerStore: { chat: null, calendar: null }, windowDimensions: { width: 0, height: 0 }, notifPermissionAlertInfo: defaultNotifPermissionAlertInfo, - connection: connectionPromise, watchedThreadIDs: [], lifecycleState: 'active', enabledApps: defaultWebEnabledApps, diff --git a/lib/reducers/master-reducer.js b/lib/reducers/master-reducer.js --- a/lib/reducers/master-reducer.js +++ b/lib/reducers/master-reducer.js @@ -1,7 +1,6 @@ // @flow import reduceCalendarFilters from './calendar-filters-reducer.js'; -import reduceConnectionInfo from './connection-reducer.js'; import reduceDataLoaded from './data-loaded-reducer.js'; import { reduceDeviceToken } from './device-token-reducer.js'; import { reduceDraftStore } from './draft-reducer.js'; @@ -59,8 +58,6 @@ reduceMessageStore(state.messageStore, action, threadInfos); let messageStore = reducedMessageStore; - const connection = reduceConnectionInfo(state.connection, action); - let keyserverStore = reduceKeyserverStore(state.keyserverStore, action); if ( @@ -131,7 +128,6 @@ state.notifPermissionAlertInfo, action, ), - connection, lifecycleState: reduceLifecycleState(state.lifecycleState, action), enabledApps: reduceEnabledApps(state.enabledApps, action), reportStore, 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 @@ -93,7 +93,6 @@ } from './search-types.js'; import type { SetSessionPayload } from './session-types.js'; import type { - ConnectionInfo, StateSyncFullActionPayload, StateSyncIncrementalActionPayload, UpdateConnectionStatusPayload, @@ -127,7 +126,6 @@ +loadingStatuses: { [key: string]: { [idx: number]: LoadingStatus } }, +calendarFilters: $ReadOnlyArray, +notifPermissionAlertInfo: NotifPermissionAlertInfo, - +connection: ConnectionInfo, +watchedThreadIDs: $ReadOnlyArray, +lifecycleState: LifecycleState, +enabledApps: EnabledApps, diff --git a/native/redux/persist.js b/native/redux/persist.js --- a/native/redux/persist.js +++ b/native/redux/persist.js @@ -148,14 +148,14 @@ actualizedCalendarQuery: undefined, }, }), - [9]: (state: AppState) => ({ + [9]: state => ({ ...state, connection: { ...state.connection, lateResponses: [], }, }), - [10]: (state: AppState) => ({ + [10]: state => ({ ...state, nextLocalID: highestLocalIDSelector(state) + 1, connection: { @@ -594,7 +594,7 @@ } return state; }, - [43]: async (state: AppState) => { + [43]: async state => { const { messages, drafts, threads, messageStoreThreads } = await commCoreModule.getClientDBStore(); @@ -699,6 +699,23 @@ }, }; }, + [48]: async state => { + const { connection, keyserverStore, ...rest } = state; + + return { + ...rest, + keyserverStore: { + ...keyserverStore, + keyserverInfos: { + ...keyserverStore.keyserverInfos, + [ashoatKeyserverID]: { + ...keyserverStore.keyserverInfos[ashoatKeyserverID], + connection, + }, + }, + }, + }; + }, }; // After migration 31, we'll no longer want to persist `messageStore.messages` @@ -793,7 +810,7 @@ 'storeLoaded', ], debug: __DEV__, - version: 47, + version: 48, transforms: [messageStoreMessagesBlocklistTransform, reportStoreTransform], migrate: (createAsyncMigrate(migrations, { debug: __DEV__ }): any), timeout: ((__DEV__ ? 0 : undefined): number | void), diff --git a/native/redux/redux-setup.js b/native/redux/redux-setup.js --- a/native/redux/redux-setup.js +++ b/native/redux/redux-setup.js @@ -94,7 +94,6 @@ dataLoaded: false, customServer: natNodeServer, notifPermissionAlertInfo: defaultNotifPermissionAlertInfo, - connection: defaultConnectionInfo(Platform.OS), watchedThreadIDs: [], lifecycleState: 'active', enabledApps: defaultEnabledApps, diff --git a/native/redux/state-types.js b/native/redux/state-types.js --- a/native/redux/state-types.js +++ b/native/redux/state-types.js @@ -15,7 +15,6 @@ import type { MessageStore } from 'lib/types/message-types.js'; import type { UserPolicies } from 'lib/types/policy-types.js'; import type { ReportStore } from 'lib/types/report-types.js'; -import type { ConnectionInfo } from 'lib/types/socket-types.js'; import type { ThreadStore } from 'lib/types/thread-types.js'; import type { CurrentUserInfo, UserStore } from 'lib/types/user-types.js'; import type { NotifPermissionAlertInfo } from 'lib/utils/push-alerts.js'; @@ -41,7 +40,6 @@ +dataLoaded: boolean, +customServer: ?string, +notifPermissionAlertInfo: NotifPermissionAlertInfo, - +connection: ConnectionInfo, +watchedThreadIDs: $ReadOnlyArray, +lifecycleState: LifecycleState, +enabledApps: EnabledApps, diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js --- a/web/redux/redux-setup.js +++ b/web/redux/redux-setup.js @@ -31,7 +31,6 @@ import type { UserPolicies } from 'lib/types/policy-types.js'; import type { BaseAction } from 'lib/types/redux-types.js'; import type { ReportStore } from 'lib/types/report-types.js'; -import type { ConnectionInfo } from 'lib/types/socket-types.js'; import type { ThreadStore } from 'lib/types/thread-types.js'; import type { CurrentUserInfo, UserStore } from 'lib/types/user-types.js'; import { setNewSessionActionType } from 'lib/utils/action-utils.js'; @@ -82,7 +81,6 @@ +windowDimensions: WindowDimensions, +deviceToken: ?string, +notifPermissionAlertInfo: NotifPermissionAlertInfo, - +connection: ConnectionInfo, +watchedThreadIDs: $ReadOnlyArray, +lifecycleState: LifecycleState, +enabledApps: EnabledApps,