From 2e945281fc582b81358d95395bf973f280a0dbe0 Mon Sep 17 00:00:00 2001 From: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Date: Wed, 17 Sep 2025 19:15:04 +0530 Subject: [PATCH] fix: beta migration check (#22092) fix: beta migration Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> --- mobile/lib/utils/migration.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/lib/utils/migration.dart b/mobile/lib/utils/migration.dart index 653c3f4347..f4f0564425 100644 --- a/mobile/lib/utils/migration.dart +++ b/mobile/lib/utils/migration.dart @@ -65,7 +65,7 @@ Future migrateDatabaseIfNeeded(Isar db, Drift drift) async { // Handle migration only for this version // TODO: remove when old timeline is removed final needBetaMigration = Store.tryGet(StoreKey.needBetaMigration); - if (version == 15 && needBetaMigration == null) { + if (version >= 15 && needBetaMigration == null) { // Check both databases directly instead of relying on cache final isBeta = Store.tryGet(StoreKey.betaTimeline); @@ -73,7 +73,7 @@ Future migrateDatabaseIfNeeded(Isar db, Drift drift) async { // For new installations, no migration needed // For existing installations, only migrate if beta timeline is not enabled (null or false) - if (isNewInstallation || isBeta == true) { + if (isNewInstallation || isBeta == true || (version > 15 && isBeta == null)) { await Store.put(StoreKey.needBetaMigration, false); await Store.put(StoreKey.betaTimeline, true); } else {