π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob]Improve handling of multiple assignment of same faceID to different clusters
Neeraj Guptaf3647df1e9ca
diff --git a/mobile/lib/services/machine_learning/face_ml/person/person_service.dart b/mobile/lib/services/machine_learning/face_ml/person/person_service.dartindex 774267de1c..509862abc8 100644--- a/mobile/lib/services/machine_learning/face_ml/person/person_service.dart+++ b/mobile/lib/services/machine_learning/face_ml/person/person_service.dart@@ -170,7 +170,13 @@ class PersonService {faceCount += cluster.faces.length;for (var faceId in cluster.faces) {if (faceIdToClusterID.containsKey(faceId)) {- throw Exception("Face $faceId is already assigned to a cluster");+ final otherPersonID = clusterToPersonID[faceIdToClusterID[faceId]!];+ if (otherPersonID != e.id) {+ final otherPerson = await getPerson(otherPersonID!);+ throw Exception(+ "Face $faceId is already assigned to person $otherPersonID (${otherPerson!.data.name}) and person ${e.id} (${personData.name})",+ );+ }}faceIdToClusterID[faceId] = cluster.id;}