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 @@ -236,10 +236,6 @@ _persist: t.Nil, commServicesAccessToken: t.Nil, inviteLinksStore: inviteLinksStoreValidator, - lastCommunicatedPlatformDetails: t.irreducible( - 'default lastCommunicatedPlatformDetails', - _isEqual(null), - ), keyserverStore: keyserverStoreValidator, }); @@ -606,7 +602,6 @@ _persist: null, commServicesAccessToken: null, inviteLinksStore: inviteLinksStorePromise, - lastCommunicatedPlatformDetails: null, keyserverStore: keyserverStorePromise, }); const validatedInitialReduxState = validateOutput( 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 @@ -9,7 +9,6 @@ import { reduceEntryInfos } from './entry-reducer.js'; import reduceInviteLinks from './invite-links-reducer.js'; import reduceKeyserverStore from './keyserver-reducer.js'; -import reduceLastCommunicatedPlatformDetails from './last-communicated-platform-details-reducer.js'; import reduceLifecycleState from './lifecycle-state-reducer.js'; import { reduceLoadingStatuses } from './loading-reducer.js'; import reduceNextLocalID from './local-id-reducer.js'; @@ -145,10 +144,6 @@ action, ), inviteLinksStore: reduceInviteLinks(state.inviteLinksStore, action), - lastCommunicatedPlatformDetails: reduceLastCommunicatedPlatformDetails( - state.lastCommunicatedPlatformDetails, - action, - ), keyserverStore, }, storeOperations: { 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 @@ -135,7 +135,6 @@ +deviceToken: ?string, +commServicesAccessToken: ?string, +inviteLinksStore: InviteLinksStore, - +lastCommunicatedPlatformDetails: ?PlatformDetails, +keyserverStore: KeyserverStore, ... }; diff --git a/native/redux/persist.js b/native/redux/persist.js --- a/native/redux/persist.js +++ b/native/redux/persist.js @@ -757,6 +757,23 @@ actualizedCalendarQuery, }; }, + [51]: async state => { + const { lastCommunicatedPlatformDetails, keyserverStore, ...rest } = state; + + return { + ...rest, + keyserverStore: { + ...keyserverStore, + keyserverInfos: { + ...keyserverStore.keyserverInfos, + [ashoatKeyserverID]: { + ...keyserverStore.keyserverInfos[ashoatKeyserverID], + lastCommunicatedPlatformDetails, + }, + }, + }, + }; + }, }; // After migration 31, we'll no longer want to persist `messageStore.messages` @@ -888,7 +905,7 @@ 'connection', ], debug: __DEV__, - version: 50, + version: 51, transforms: [ messageStoreMessagesBlocklistTransform, reportStoreTransform, 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 @@ -120,7 +120,6 @@ inviteLinksStore: { links: {}, }, - lastCommunicatedPlatformDetails: null, keyserverStore: { keyserverInfos: { [ashoatKeyserverID]: { 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 @@ -3,7 +3,6 @@ import type { Orientations } from 'react-native-orientation-locker'; import type { PersistState } from 'redux-persist/es/types.js'; -import type { PlatformDetails } from 'lib/types/device-types.js'; import type { DraftStore } from 'lib/types/draft-types.js'; import type { EnabledApps } from 'lib/types/enabled-apps.js'; import type { EntryStore, CalendarQuery } from 'lib/types/entry-types.js'; @@ -56,6 +55,5 @@ +userPolicies: UserPolicies, +commServicesAccessToken: ?string, +inviteLinksStore: InviteLinksStore, - +lastCommunicatedPlatformDetails: ?PlatformDetails, +keyserverStore: KeyserverStore, }; diff --git a/web/redux/persist.js b/web/redux/persist.js --- a/web/redux/persist.js +++ b/web/redux/persist.js @@ -27,6 +27,7 @@ generateIDSchemaMigrationOpsForDrafts, convertDraftStoreToNewIDSchema, } from 'lib/utils/migration-utils.js'; +import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; import commReduxStorageEngine from './comm-redux-storage-engine.js'; import type { AppState } from './redux-setup.js'; @@ -107,6 +108,23 @@ return newState; }, + [4]: async state => { + const { lastCommunicatedPlatformDetails, keyserverStore, ...rest } = state; + + return { + ...rest, + keyserverStore: { + ...keyserverStore, + keyserverInfos: { + ...keyserverStore.keyserverInfos, + [ashoatKeyserverID]: { + ...keyserverStore.keyserverInfos[ashoatKeyserverID], + lastCommunicatedPlatformDetails, + }, + }, + }, + }; + }, }; const persistWhitelist = [ @@ -115,7 +133,6 @@ 'cryptoStore', 'notifPermissionAlertInfo', 'commServicesAccessToken', - 'lastCommunicatedPlatformDetails', 'keyserverStore', ]; @@ -195,7 +212,7 @@ { debug: isDev }, migrateStorageToSQLite, ): any), - version: 3, + version: 4, transforms: [keyserverStoreTransform], }; 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 @@ -18,7 +18,6 @@ OLMIdentityKeys, PickledOLMAccount, } from 'lib/types/crypto-types.js'; -import type { PlatformDetails } from 'lib/types/device-types.js'; import type { DraftStore } from 'lib/types/draft-types.js'; import type { EnabledApps } from 'lib/types/enabled-apps.js'; import type { EntryStore, CalendarQuery } from 'lib/types/entry-types.js'; @@ -95,7 +94,6 @@ +_persist: ?PersistState, +commServicesAccessToken: ?string, +inviteLinksStore: InviteLinksStore, - +lastCommunicatedPlatformDetails: ?PlatformDetails, +keyserverStore: KeyserverStore, };