retry cloud id mapping on migration

This commit is contained in:
shenlong-tanwen 2025-08-31 23:42:19 +05:30
parent d81ee18238
commit 867f4fc53a

View File

@ -71,7 +71,13 @@ Future<void> migrateDatabaseIfNeeded(Isar db, Drift drift) async {
}
if (version < 15) {
try {
await _updateCloudId(drift);
} catch (error) {
Logger("Migration").warning("Error occurred while updating cloud ID: $error");
// do not update version when error occurs so this is retried the next time
return;
}
}
if (targetVersion >= 12) {