Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3514789
D12013.id40227.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
937 B
Referenced Files
None
Subscribers
None
D12013.id40227.diff
View Options
diff --git a/native/backup/use-client-backup.js b/native/backup/use-client-backup.js
--- a/native/backup/use-client-backup.js
+++ b/native/backup/use-client-backup.js
@@ -9,6 +9,7 @@
import { fetchNativeKeychainCredentials } from '../account/native-credentials.js';
import { commCoreModule } from '../native-modules.js';
+import { persistConfig } from '../redux/persist.js';
import { useSelector } from '../redux/redux-utils.js';
type ClientBackup = {
@@ -89,6 +90,11 @@
const backupSecret = await getBackupSecret();
await commCoreModule.restoreBackup(backupSecret);
+ const backupVersion = await commCoreModule.getSyncedDatabaseVersion();
+ if (!backupVersion || parseInt(backupVersion) > persistConfig.version) {
+ throw new Error(`Incompatible backup version ${backupVersion ?? -1}`);
+ }
+
console.info('Backup restored.');
}, [currentUserID, loggedIn, setMockCommServicesAuthMetadata]);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 6:36 AM (17 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2693823
Default Alt Text
D12013.id40227.diff (937 B)
Attached To
Mode
D12013: [native] Verify if the backup version is correct
Attached
Detach File
Event Timeline
Log In to Comment