Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32161561
D15048.1765043510.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
7 KB
Referenced Files
None
Subscribers
None
D15048.1765043510.diff
View Options
diff --git a/lib/utils/migration-utils.js b/lib/utils/migration-utils.js
--- a/lib/utils/migration-utils.js
+++ b/lib/utils/migration-utils.js
@@ -177,7 +177,7 @@
];
export type LegacyMigrationManifest<N: BaseNavInfo, T: BaseAppState<N>> = {
- +[number | string]: (T) => Promise<T>,
+ +[number | string]: (T) => Promise<T> | T,
};
type PersistedState<N: BaseNavInfo, T: BaseAppState<N>> = T | void;
type ConfigType = {
diff --git a/native/redux/persist.js b/native/redux/persist.js
--- a/native/redux/persist.js
+++ b/native/redux/persist.js
@@ -180,37 +180,41 @@
import { codeVersion } from '../version.mjs';
const legacyMigrations = {
- [1]: (state: AppState) => ({
- ...state,
- notifPermissionAlertInfo: defaultAlertInfo,
- }),
- [2]: (state: AppState) => ({
- ...state,
- messageSentFromRoute: [],
- }),
- [3]: (state: any) => ({
- currentUserInfo: state.currentUserInfo,
- entryStore: state.entryStore,
- threadInfos: state.threadInfos,
- userInfos: state.userInfos,
- messageStore: {
- ...state.messageStore,
- currentAsOf: state.currentAsOf,
- },
- updatesCurrentAsOf: state.currentAsOf,
- cookie: state.cookie,
- deviceToken: state.deviceToken,
- urlPrefix: state.urlPrefix,
- customServer: state.customServer,
- notifPermissionAlertInfo: state.notifPermissionAlertInfo,
- messageSentFromRoute: state.messageSentFromRoute,
- _persist: state._persist,
- }),
- [4]: (state: AppState) => ({
- ...state,
- pingTimestamps: undefined,
- activeServerRequests: undefined,
- }),
+ [1]: (state: AppState) =>
+ ({
+ ...state,
+ notifPermissionAlertInfo: defaultAlertInfo,
+ }) as any,
+ [2]: (state: AppState) =>
+ ({
+ ...state,
+ messageSentFromRoute: [],
+ }) as any,
+ [3]: (state: any) =>
+ ({
+ currentUserInfo: state.currentUserInfo,
+ entryStore: state.entryStore,
+ threadInfos: state.threadInfos,
+ userInfos: state.userInfos,
+ messageStore: {
+ ...state.messageStore,
+ currentAsOf: state.currentAsOf,
+ },
+ updatesCurrentAsOf: state.currentAsOf,
+ cookie: state.cookie,
+ deviceToken: state.deviceToken,
+ urlPrefix: state.urlPrefix,
+ customServer: state.customServer,
+ notifPermissionAlertInfo: state.notifPermissionAlertInfo,
+ messageSentFromRoute: state.messageSentFromRoute,
+ _persist: state._persist,
+ }) as any,
+ [4]: (state: AppState) =>
+ ({
+ ...state,
+ pingTimestamps: undefined,
+ activeServerRequests: undefined,
+ }) as any,
[5]: (state: AppState) => ({
...state,
calendarFilters: defaultCalendarFilters,
@@ -223,29 +227,31 @@
inconsistencyResponses: [],
},
}),
- [7]: (state: AppState) => ({
- ...state,
- lastUserInteraction: undefined,
- sessionID: undefined,
- entryStore: {
- ...state.entryStore,
- inconsistencyResponses: [],
- },
- }),
- [8]: (state: AppState) => ({
- ...state,
- pingTimestamps: undefined,
- activeServerRequests: undefined,
- connection: {
- ...defaultConnectionInfo,
- actualizedCalendarQuery: defaultCalendarQuery(Platform.OS),
- },
- watchedThreadIDs: [],
- entryStore: {
- ...state.entryStore,
- actualizedCalendarQuery: undefined,
- },
- }),
+ [7]: (state: AppState) =>
+ ({
+ ...state,
+ lastUserInteraction: undefined,
+ sessionID: undefined,
+ entryStore: {
+ ...state.entryStore,
+ inconsistencyResponses: [],
+ },
+ }) as any,
+ [8]: (state: AppState) =>
+ ({
+ ...state,
+ pingTimestamps: undefined,
+ activeServerRequests: undefined,
+ connection: {
+ ...defaultConnectionInfo,
+ actualizedCalendarQuery: defaultCalendarQuery(Platform.OS),
+ },
+ watchedThreadIDs: [],
+ entryStore: {
+ ...state.entryStore,
+ actualizedCalendarQuery: undefined,
+ },
+ }) as any,
[9]: (state: any) => ({
...state,
connection: {
@@ -326,7 +332,7 @@
userStore: {
userInfos: state.userStore.userInfos,
inconsistencyReports: [],
- },
+ } as any,
}),
[19]: (state: any) => {
const threadInfos: { [string]: LegacyRawThreadInfo } = {};
@@ -380,10 +386,11 @@
...state,
enabledApps: defaultEnabledApps,
}),
- [25]: (state: AppState) => ({
- ...state,
- crashReportsEnabled: __DEV__,
- }),
+ [25]: (state: AppState) =>
+ ({
+ ...state,
+ crashReportsEnabled: __DEV__,
+ }) as any,
[26]: (state: any) => {
const { currentUserInfo } = state;
if (currentUserInfo.anonymous) {
@@ -486,7 +493,7 @@
...state,
threadStore: {
...state.threadStore,
- threadInfos: updatedThreadInfos,
+ threadInfos: updatedThreadInfos as any,
},
};
},
@@ -514,7 +521,7 @@
if (isTaskCancelledError(exception)) {
return state;
}
- return { ...state, cookie: null };
+ return { ...state, cookie: null } as any;
}
return state;
},
@@ -537,7 +544,7 @@
if (isTaskCancelledError(exception)) {
return state;
}
- return { ...state, cookie: null };
+ return { ...state, cookie: null } as any;
}
return state;
},
@@ -650,7 +657,7 @@
commCoreModule.processThreadStoreOperationsSync(operations);
} catch (exception) {
console.log(exception);
- return { ...state, cookie: null };
+ return { ...state, cookie: null } as any;
}
return state;
@@ -677,7 +684,7 @@
if (isTaskCancelledError(exception)) {
return state;
}
- return { ...state, cookie: null };
+ return { ...state, cookie: null } as any;
}
return state;
@@ -718,7 +725,7 @@
if (isTaskCancelledError(exception)) {
return state;
}
- return { ...state, cookie: null };
+ return { ...state, cookie: null } as any;
}
return state;
},
@@ -757,7 +764,7 @@
});
} catch (exception) {
console.log(exception);
- return { ...state, cookie: null };
+ return { ...state, cookie: null } as any;
}
const inviteLinksStore =
@@ -805,13 +812,14 @@
};
},
[46]: async (state: AppState) => {
- const { currentAsOf } = state.messageStore;
-
return {
...state,
messageStore: {
...state.messageStore,
- currentAsOf: { [authoritativeKeyserverID]: currentAsOf },
+ currentAsOf: {
+ ...state.messageStore.currentAsOf,
+ [authoritativeKeyserverID]: 0,
+ },
},
};
},
@@ -862,12 +870,12 @@
keyserverInfos: {
...keyserverStore.keyserverInfos,
[authoritativeKeyserverID]: {
- ...keyserverRest,
+ ...(keyserverRest as any),
},
},
},
connection,
- };
+ } as any;
},
[50]: async (state: any) => {
const { connection, ...rest } = state;
@@ -1253,7 +1261,7 @@
},
[68]: async (state: AppState) => {
const { userStore, ...rest } = state;
- return rest;
+ return rest as any;
},
[69]: (state: any) => {
const { notifPermissionAlertInfo, ...rest } = state;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 5:51 PM (19 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5839647
Default Alt Text
D15048.1765043510.diff (7 KB)
Attached To
Mode
D15048: [Flow262][skip-ci] Fix types in store migration
Attached
Detach File
Event Timeline
Log In to Comment