diff --git a/lib/reducers/user-reducer.js b/lib/reducers/user-reducer.js --- a/lib/reducers/user-reducer.js +++ b/lib/reducers/user-reducer.js @@ -153,7 +153,6 @@ return [ { userInfos: {}, - inconsistencyReports: state.inconsistencyReports, }, [], ]; @@ -170,7 +169,6 @@ return [ { userInfos: newUserInfos, - inconsistencyReports: state.inconsistencyReports, }, [], ]; @@ -233,7 +231,6 @@ return [ { userInfos: newUserInfos, - inconsistencyReports: state.inconsistencyReports, }, newInconsistencies, ]; diff --git a/lib/types/user-types.js b/lib/types/user-types.js --- a/lib/types/user-types.js +++ b/lib/types/user-types.js @@ -11,7 +11,6 @@ type UserRelationshipStatus, userRelationshipStatusValidator, } from './relationship-types.js'; -import type { UserInconsistencyReportCreationRequest } from './report-types.js'; import { tBool, tShape } from '../utils/validation-utils.js'; export type GlobalUserInfo = { @@ -66,7 +65,6 @@ export type UserStore = { +userInfos: UserInfos, - +inconsistencyReports: $ReadOnlyArray, }; export type RelativeUserInfo = { diff --git a/native/redux/default-state.js b/native/redux/default-state.js --- a/native/redux/default-state.js +++ b/native/redux/default-state.js @@ -32,7 +32,6 @@ }, userStore: { userInfos: {}, - inconsistencyReports: [], }, messageStore: { messages: {}, diff --git a/native/redux/persist.js b/native/redux/persist.js --- a/native/redux/persist.js +++ b/native/redux/persist.js @@ -783,6 +783,38 @@ threadHashingStatus: 'data_not_loaded', }, }), + [53]: state => { + if (!state.userStore.inconsistencyReports) { + return state; + } + const reportStoreOperations = convertReportsToReplaceReportOps( + state.userStore.inconsistencyReports, + ); + const dbOperations: $ReadOnlyArray = + reportStoreOpsHandlers.convertOpsToClientDBOps(reportStoreOperations); + try { + commCoreModule.processReportStoreOperationsSync(dbOperations); + } catch (exception) { + if (isTaskCancelledError(exception)) { + return state; + } + return { ...state, cookie: null }; + } + + const { inconsistencyReports, ...newUserStore } = state.userStore; + const queuedReports = reportStoreOpsHandlers.processStoreOperations( + state.reportStore.queuedReports, + reportStoreOperations, + ); + return { + ...state, + userStore: newUserStore, + reportStore: { + ...state.reportStore, + queuedReports, + }, + }; + }, }; // After migration 31, we'll no longer want to persist `messageStore.messages` @@ -914,7 +946,7 @@ 'connection', ], debug: __DEV__, - version: 52, + version: 53, transforms: [ messageStoreMessagesBlocklistTransform, reportStoreTransform, 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 @@ -28,7 +28,6 @@ }, userStore: { userInfos: {}, - inconsistencyReports: [], }, messageStore: { messages: {}, 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 @@ -134,7 +134,7 @@ return validateState(oldState, { ...state, ...rest, - userStore: { userInfos, inconsistencyReports: [] }, + userStore: { userInfos }, keyserverStore: { ...state.keyserverStore, keyserverInfos: {