Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3179667
D11947.id40881.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11947.id40881.diff
View Options
diff --git a/web/redux/persist-constants.js b/web/redux/persist-constants.js
--- a/web/redux/persist-constants.js
+++ b/web/redux/persist-constants.js
@@ -3,5 +3,6 @@
const rootKey = 'root';
const rootKeyPrefix = 'persist:';
const completeRootKey = `${rootKeyPrefix}${rootKey}`;
+const storeVersion = 75;
-export { rootKey, rootKeyPrefix, completeRootKey };
+export { rootKey, rootKeyPrefix, completeRootKey, storeVersion };
diff --git a/web/redux/persist.js b/web/redux/persist.js
--- a/web/redux/persist.js
+++ b/web/redux/persist.js
@@ -47,7 +47,7 @@
handleReduxMigrationFailure,
persistWhitelist,
} from './handle-redux-migration-failure.js';
-import { rootKey, rootKeyPrefix } from './persist-constants.js';
+import { rootKey, rootKeyPrefix, storeVersion } from './persist-constants.js';
import type { AppState } from './redux-setup.js';
import { unshimClientDB } from './unshim-utils.js';
import { authoritativeKeyserverID } from '../authoritative-keyserver.js';
@@ -530,7 +530,7 @@
(error: Error, state: AppState) => handleReduxMigrationFailure(state),
migrateStorageToSQLite,
): any),
- version: 75,
+ version: storeVersion,
transforms: [messageStoreMessagesBlocklistTransform, keyserverStoreTransform],
};
diff --git a/web/shared-worker/types/sqlite-query-executor.js b/web/shared-worker/types/sqlite-query-executor.js
--- a/web/shared-worker/types/sqlite-query-executor.js
+++ b/web/shared-worker/types/sqlite-query-executor.js
@@ -159,6 +159,7 @@
restoreFromMainCompaction(
mainCompactionPath: string,
mainCompactionEncryptionKey: string,
+ maxVersion: string,
): void;
restoreFromBackupLog(backupLog: Uint8Array): void;
diff --git a/web/shared-worker/worker/backup.js b/web/shared-worker/worker/backup.js
--- a/web/shared-worker/worker/backup.js
+++ b/web/shared-worker/worker/backup.js
@@ -9,7 +9,10 @@
BackupClient,
RequestedData,
} from '../../backup-client-wasm/wasm/backup-client-wasm.js';
-import { completeRootKey } from '../../redux/persist-constants.js';
+import {
+ completeRootKey,
+ storeVersion,
+} from '../../redux/persist-constants.js';
import type { EmscriptenModule } from '../types/module.js';
import type { SQLiteQueryExecutor } from '../types/sqlite-query-executor.js';
import { COMM_SQLITE_BACKUP_RESTORE_DATABASE_PATH } from '../utils/constants.js';
@@ -53,6 +56,7 @@
sqliteQueryExecutor.restoreFromMainCompaction(
COMM_SQLITE_BACKUP_RESTORE_DATABASE_PATH,
backupDataKey,
+ `${storeVersion ?? -1}`,
);
sqliteQueryExecutor.setPersistStorageItem(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 3:24 AM (18 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2447215
Default Alt Text
D11947.id40881.diff (2 KB)
Attached To
Mode
D11947: [web] Check backup version when restoring
Attached
Detach File
Event Timeline
Log In to Comment