Skip to content

armgit / ente

Public Imported from GitHub
0

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

Remove more offline references

laurenspriem7288117f1b7c
diff --git a/mobile/apps/photos/lib/services/filedata/filedata_service.dart b/mobile/apps/photos/lib/services/filedata/filedata_service.dart
index 33f700dfb8..69e12a3cde 100644
--- a/mobile/apps/photos/lib/services/filedata/filedata_service.dart
+++ b/mobile/apps/photos/lib/services/filedata/filedata_service.dart
@@ -131,7 +131,7 @@ class FileDataService {
Future<void> _syncFDStatusInternal() async {
if (isLocalGalleryMode) {
- _logger.fine("Skipping file data sync in offline mode");
+ _logger.fine("Skipping file data sync in local gallery mode");
return;
}
try {
diff --git a/mobile/apps/photos/lib/services/machine_learning/face_ml/face_recognition_service.dart b/mobile/apps/photos/lib/services/machine_learning/face_ml/face_recognition_service.dart
index edec65cec9..8490eba79f 100644
--- a/mobile/apps/photos/lib/services/machine_learning/face_ml/face_recognition_service.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/face_ml/face_recognition_service.dart
@@ -54,7 +54,7 @@ class FaceRecognitionService {
return;
}
if (isLocalGalleryMode) {
- _logger.finest("Skipping person feedback sync in offline mode");
+ _logger.finest("Skipping person feedback sync in local gallery mode");
return;
}
_isSyncing = true;
diff --git a/mobile/apps/photos/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart b/mobile/apps/photos/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart
index 4eac07fea5..3d1c39ba6b 100644
--- a/mobile/apps/photos/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart
@@ -49,8 +49,8 @@ class ClusterFeedbackService<T> {
ClusterFeedbackService._privateConstructor();
late final mlDataDB = MLDataDB.instance;
- // Person entities and person suggestions are online-only; keep all
- // suggestion centroid mapping/vector access pinned to the online DB.
+ // Person entities and person suggestions require an Ente account; keep all
+ // suggestion centroid mapping/vector access pinned to the Ente account DB.
MLDataDB get _mlDataDBForCentroidVectorDb => MLDataDB.instance;
ClusterCentroidVectorDB get _clusterCentroidVectorDB =>
ClusterCentroidVectorDB.instance;
@@ -75,11 +75,11 @@ class ClusterFeedbackService<T> {
}) async {
assert(
!isLocalGalleryMode,
- "Person suggestions are online-only and should not run in offline mode.",
+ "Person suggestions require an Ente account and should not run in local gallery mode.",
);
if (isLocalGalleryMode) {
_logger.info(
- "Skipping getSuggestionForPerson in offline mode because person suggestions are online-only",
+ "Skipping getSuggestionForPerson in local gallery mode because person suggestions require an Ente account",
);
return [];
}
@@ -1709,11 +1709,11 @@ class ClusterFeedbackService<T> {
}) async {
assert(
!isLocalGalleryMode,
- "Fast person suggestions are online-only and should not run in offline mode.",
+ "Fast person suggestions require an Ente account and should not run in local gallery mode.",
);
if (isLocalGalleryMode) {
_logger.info(
- "Skipping _getFastSuggestions in offline mode because person suggestions are online-only",
+ "Skipping _getFastSuggestions in local gallery mode because person suggestions require an Ente account",
);
return [];
}
diff --git a/mobile/apps/photos/lib/services/machine_learning/face_ml/person/person_service.dart b/mobile/apps/photos/lib/services/machine_learning/face_ml/person/person_service.dart
index c60fd40fce..36e561c32e 100644
--- a/mobile/apps/photos/lib/services/machine_learning/face_ml/person/person_service.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/face_ml/person/person_service.dart
@@ -434,7 +434,7 @@ class PersonService {
bool skipClusterUpdateIfNoChange = true,
}) async {
if (isLocalGalleryMode) {
- logger.finest("Skip fetching remote clusters in offline mode");
+ logger.finest("Skip fetching remote clusters in local gallery mode");
return false;
}
final int changedEntities = await entityService.syncEntity(
diff --git a/mobile/apps/photos/lib/services/machine_learning/ml_service.dart b/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
index 139c8a6d54..bd68e9b6d7 100644
--- a/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
@@ -66,10 +66,10 @@ class MLService {
_isRunningML || memoriesCacheService.isUpdatingMemories;
static const _kForceClusteringFaceCount = 8000;
- static const _kForceClusteringFaceCountOffline = 100;
+ static const _kForceClusteringFaceCountLocalGallery = 100;
int _forceClusteringFaceCountForMode(MLMode mode) {
return mode == MLMode.localGallery
- ? _kForceClusteringFaceCountOffline
+ ? _kForceClusteringFaceCountLocalGallery
: _kForceClusteringFaceCount;
}
@@ -560,14 +560,14 @@ class MLService {
}
}
} else {
- _logger.info("Skipping person metadata in offline mode");
+ _logger.info("Skipping person metadata in local gallery mode");
}
try {
// Get a sense of the total number of faces in the database
final int totalFaces = await _mlDataDB.getTotalFaceCount();
final fileIDToCreationTime = isLocalGalleryMode
- ? await _getOfflineFileIdToCreationTime()
+ ? await _getLocalGalleryFileIdToCreationTime()
: await FilesDB.instance.getFileIDToCreationTime();
final startEmbeddingFetch = DateTime.now();
// read all embeddings
@@ -976,7 +976,7 @@ class MLService {
return true;
}
- Future<Map<int, int>> _getOfflineFileIdToCreationTime() async {
+ Future<Map<int, int>> _getLocalGalleryFileIdToCreationTime() async {
final files = await SearchService.instance.getAllFilesForSearch();
final localIdToCreation = <String, int>{};
for (final file in files) {
diff --git a/mobile/apps/photos/lib/services/machine_learning/semantic_search/semantic_search_service.dart b/mobile/apps/photos/lib/services/machine_learning/semantic_search/semantic_search_service.dart
index 0c3c2cc6ab..0811208c5b 100644
--- a/mobile/apps/photos/lib/services/machine_learning/semantic_search/semantic_search_service.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/semantic_search/semantic_search_service.dart
@@ -43,7 +43,7 @@ class SemanticSearchService {
final _cacheLock = Lock();
bool _imageEmbeddingsAreCached = false;
- bool? _cachedEmbeddingsOffline;
+ bool? _cachedEmbeddingsLocalGallery;
Timer? _embeddingsCacheTimer;
final Duration _embeddingsCacheDuration = const Duration(seconds: 60);
static const Duration _vectorDbMigrationDelay = Duration(seconds: 10);
@@ -175,10 +175,10 @@ class SemanticSearchService {
return _cacheLock.synchronized(() async {
_resetInactivityTimer();
if (_imageEmbeddingsAreCached) {
- if (_cachedEmbeddingsOffline != isLocalGalleryMode) {
+ if (_cachedEmbeddingsLocalGallery != isLocalGalleryMode) {
await MLComputer.instance.clearImageEmbeddingsCache();
_imageEmbeddingsAreCached = false;
- _cachedEmbeddingsOffline = null;
+ _cachedEmbeddingsLocalGallery = null;
} else {
return;
}
@@ -196,7 +196,7 @@ class SemanticSearchService {
cacheRustExact: _shouldUseRustExactSearch,
);
_imageEmbeddingsAreCached = true;
- _cachedEmbeddingsOffline = isLocalGalleryMode;
+ _cachedEmbeddingsLocalGallery = isLocalGalleryMode;
return;
});
}
@@ -238,7 +238,7 @@ class SemanticSearchService {
}
if (isLocalGalleryMode) {
- return _getOfflineMatchingFiles(
+ return _getLocalGalleryMatchingFiles(
queryResults,
fileIDToScoreMap,
showThreshold,
@@ -279,7 +279,7 @@ class SemanticSearchService {
return results;
}
- Future<List<EnteFile>> _getOfflineMatchingFiles(
+ Future<List<EnteFile>> _getLocalGalleryMatchingFiles(
List<QueryResult> queryResults,
Map<int, double> fileIDToScoreMap,
bool showThreshold,
diff --git a/mobile/apps/photos/lib/services/smart_memories_service.dart b/mobile/apps/photos/lib/services/smart_memories_service.dart
index 557fcc8afe..b204b96a95 100644
--- a/mobile/apps/photos/lib/services/smart_memories_service.dart
+++ b/mobile/apps/photos/lib/services/smart_memories_service.dart
@@ -275,7 +275,7 @@ class SmartMemoriesService {
if (isLocalGalleryMode && memoriesResult.isEmpty) {
_logger.severe(
- "Smart memories returned empty in offline mode, falling back to simple memories",
+ "Smart memories returned empty in local gallery mode, falling back to simple memories",
);
final fallbackMemories = await calcSimpleMemories();
return MemoriesResult(fallbackMemories, <BaseLocation>[]);
@@ -291,7 +291,7 @@ class SmartMemoriesService {
if (isLocalGalleryMode) {
try {
_logger.warning(
- "Falling back to simple memories after smart memories failure in offline mode",
+ "Falling back to simple memories after smart memories failure in local gallery mode",
);
final fallbackMemories = await calcSimpleMemories();
return MemoriesResult(fallbackMemories, <BaseLocation>[]);
diff --git a/mobile/apps/photos/lib/services/sync/local_sync_service.dart b/mobile/apps/photos/lib/services/sync/local_sync_service.dart
index fb5b19cb30..623976c97f 100644
--- a/mobile/apps/photos/lib/services/sync/local_sync_service.dart
+++ b/mobile/apps/photos/lib/services/sync/local_sync_service.dart
@@ -68,8 +68,8 @@ class LocalSyncService {
Bus.instance.on<PermissionGrantedEvent>().listen((event) async {
_registerChangeCallback();
if (isLocalGalleryMode) {
- // Offline onboarding grants permission without explicitly invoking
- // SyncService, so trigger local import right away.
+ // Local gallery onboarding grants permission without explicitly
+ // invoking SyncService, so trigger local import right away.
unawaited(checkAndSync());
}
});
diff --git a/mobile/apps/photos/lib/services/sync/sync_service.dart b/mobile/apps/photos/lib/services/sync/sync_service.dart
index 044c02cc63..3516084ed8 100644
--- a/mobile/apps/photos/lib/services/sync/sync_service.dart
+++ b/mobile/apps/photos/lib/services/sync/sync_service.dart
@@ -202,7 +202,7 @@ class SyncService {
);
}
_logger.info(
- "[SYNC] Offline mode${Platform.isAndroid ? '' : ' (non-Android, no metadata processing)'}, skipping remote sync",
+ "[SYNC] Local gallery mode${Platform.isAndroid ? '' : ' (non-Android, no metadata processing)'}, skipping remote sync",
);
return;
}
diff --git a/mobile/apps/photos/test/services/memories/photo_selector_test.dart b/mobile/apps/photos/test/services/memories/photo_selector_test.dart
index e086a933cc..aa1f2fcf3c 100644
--- a/mobile/apps/photos/test/services/memories/photo_selector_test.dart
+++ b/mobile/apps/photos/test/services/memories/photo_selector_test.dart
@@ -100,7 +100,8 @@ FaceWithoutEmbedding _face(String faceID, int fileID) {
void main() {
group('PhotoSelector utilities', () {
- test('memoryFileId returns uploadedFileID when not offline', () {
+ test('memoryFileId returns uploadedFileID when not in local gallery mode',
+ () {
final f = _file(uploadedFileID: 42, creationTime: _baseTime);
expect(
PhotoSelector.memoryFileId(f, isLocalGalleryMode: false),
@@ -108,7 +109,7 @@ void main() {
);
});
- test('memoryFileId returns generatedID when offline', () {
+ test('memoryFileId returns generatedID when in local gallery mode', () {
final f = _file(
uploadedFileID: 42,
creationTime: _baseTime,