π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mobile][photos] Treat a failed vector index readiness check as not ready
laurenspriembf05223ba9cd
diff --git a/mobile/apps/photos/lib/db/ml/store_clip_vector_db.dart b/mobile/apps/photos/lib/db/ml/store_clip_vector_db.dartindex d612370a96..0f9e4b5369 100644--- a/mobile/apps/photos/lib/db/ml/store_clip_vector_db.dart+++ b/mobile/apps/photos/lib/db/ml/store_clip_vector_db.dart@@ -19,8 +19,19 @@ class StoreClipVectorDB implements ClipVectorDB {);@override- Future<bool> isReady() async =>- await _mlDataDB.fillState(rust.Index.clip) == rust.FillState.filled;+ Future<bool> isReady() async {+ try {+ return await _mlDataDB.fillState(rust.Index.clip) ==+ rust.FillState.filled;+ } catch (e, s) {+ _logger.warning(+ "Clip vector index readiness check failed, treating it as not ready",+ e,+ s,+ );+ return false;+ }+ }@overrideFuture<void> warmup() async {diff --git a/mobile/apps/photos/lib/db/ml/store_cluster_centroid_vector_db.dart b/mobile/apps/photos/lib/db/ml/store_cluster_centroid_vector_db.dartindex c98e089ae9..ad0b2eb4c7 100644--- a/mobile/apps/photos/lib/db/ml/store_cluster_centroid_vector_db.dart+++ b/mobile/apps/photos/lib/db/ml/store_cluster_centroid_vector_db.dart@@ -18,9 +18,19 @@ class StoreClusterCentroidVectorDB implements ClusterCentroidVectorDB {);@override- Future<bool> isReady() async =>- await _mlDataDB.fillState(rust.Index.clusterCentroid) ==- rust.FillState.filled;+ Future<bool> isReady() async {+ try {+ return await _mlDataDB.fillState(rust.Index.clusterCentroid) ==+ rust.FillState.filled;+ } catch (e, s) {+ _logger.warning(+ "Cluster centroid vector index readiness check failed, treating it as not ready",+ e,+ s,+ );+ return false;+ }+ }@overrideFuture<void> warmup() async {