Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3374496
D12157.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12157.diff
View Options
diff --git a/native/redux/persist.js b/native/redux/persist.js
--- a/native/redux/persist.js
+++ b/native/redux/persist.js
@@ -16,6 +16,11 @@
convertConnectionInfoToNewIDSchema,
} from 'lib/_generated/migration-utils.js';
import { extractKeyserverIDFromID } from 'lib/keyserver-conn/keyserver-call-utils.js';
+import type {
+ ClientDBEntryStoreOperation,
+ ReplaceEntryOperation,
+} from 'lib/ops/entries-store-ops';
+import { entryStoreOpsHandlers } from 'lib/ops/entries-store-ops.js';
import {
type ClientDBIntegrityStoreOperation,
integrityStoreOpsHandlers,
@@ -1289,6 +1294,35 @@
[messageTypes.UPDATE_RELATIONSHIP],
handleReduxMigrationFailure,
),
+ [75]: async (state: AppState) => {
+ const replaceOps: $ReadOnlyArray<ReplaceEntryOperation> = entries(
+ state.entryStore.entryInfos,
+ ).map(([id, entry]) => ({
+ type: 'replace_entry',
+ payload: {
+ id,
+ entry,
+ },
+ }));
+
+ const dbOperations: $ReadOnlyArray<ClientDBEntryStoreOperation> =
+ entryStoreOpsHandlers.convertOpsToClientDBOps([
+ { type: 'remove_all_entries' },
+ ...replaceOps,
+ ]);
+
+ try {
+ await commCoreModule.processDBStoreOperations({
+ entryStoreOperations: dbOperations,
+ });
+ } catch (exception) {
+ if (isTaskCancelledError(exception)) {
+ return state;
+ }
+ return handleReduxMigrationFailure(state);
+ }
+ return state;
+ },
};
type PersistedReportStore = $Diff<
@@ -1310,7 +1344,7 @@
storage: AsyncStorage,
blacklist: persistBlacklist,
debug: __DEV__,
- version: 74,
+ version: 75,
transforms: [
messageStoreMessagesBlocklistTransform,
reportStoreTransform,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 27, 3:45 PM (21 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2590885
Default Alt Text
D12157.diff (1 KB)
Attached To
Mode
D12157: [native] Add a migration that moves entries to SQLite
Attached
Detach File
Event Timeline
Log In to Comment