Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile][photos] Mark Rust ML store indexes stale when the Dart ML DB opens

laurenspriema5892f2abe97
diff --git a/mobile/apps/photos/lib/db/ml/dart_db.dart b/mobile/apps/photos/lib/db/ml/dart_db.dart
index c84fa0e9f7..5d1d7ecfc1 100644
--- a/mobile/apps/photos/lib/db/ml/dart_db.dart
+++ b/mobile/apps/photos/lib/db/ml/dart_db.dart
@@ -112,6 +112,7 @@ class DartMLDataDB
"MLDataDB Migration took ${stopwatch.elapsedMilliseconds} ms",
);
stopwatch.stop();
+ await asyncDBConnection.execute(deleteMlStoreMetaTable);
return asyncDBConnection;
} catch (_) {
diff --git a/mobile/apps/photos/lib/db/ml/schema.dart b/mobile/apps/photos/lib/db/ml/schema.dart
index b233423acc..cf527631b9 100644
--- a/mobile/apps/photos/lib/db/ml/schema.dart
+++ b/mobile/apps/photos/lib/db/ml/schema.dart
@@ -255,3 +255,5 @@ CREATE TABLE IF NOT EXISTS $mlStoreMetaTable (
value TEXT NOT NULL
);
''';
+
+const deleteMlStoreMetaTable = 'DELETE FROM $mlStoreMetaTable';