Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Inline sync diagnostics flag checks

Prateek Sunal1f9f325a0667
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 a6ac921430..25fbb6f041 100644
--- a/mobile/apps/photos/lib/services/sync/local_sync_service.dart
+++ b/mobile/apps/photos/lib/services/sync/local_sync_service.dart
@@ -329,7 +329,6 @@ class LocalSyncService {
required int fromTime,
required int toTime,
}) async {
- final bool shouldLogSyncRecovery = flagService.syncRecoveryDiagnostics;
final Tuple2<List<LocalPathAsset>, List<EnteFile>> result =
await getLocalPathAssetsAndFiles(fromTime, toTime);
@@ -360,7 +359,7 @@ class LocalSyncService {
conflictAlgorithm: SqliteAsyncConflictAlgorithm.ignore,
);
_logger.info('Inserted ${files.length} out of ${allFiles.length} files');
- if (shouldLogSyncRecovery && allFiles.length != files.length) {
+ if (flagService.syncRecoveryDiagnostics && allFiles.length != files.length) {
final sampleLocalIDs =
allFiles.take(3).map((file) => file.localID).toList();
_logger.info(
diff --git a/mobile/apps/photos/lib/services/sync/remote_sync_service.dart b/mobile/apps/photos/lib/services/sync/remote_sync_service.dart
index be8fa23087..0471c31f2e 100644
--- a/mobile/apps/photos/lib/services/sync/remote_sync_service.dart
+++ b/mobile/apps/photos/lib/services/sync/remote_sync_service.dart
@@ -378,7 +378,6 @@ class RemoteSyncService {
Future<void> syncDeviceCollectionFilesForUpload() async {
_logger.info("Syncing device collections to be uploaded");
final int ownerID = _config.getUserID()!;
- final bool shouldLogSyncRecovery = flagService.syncRecoveryDiagnostics;
final deviceCollections = await _db.getDeviceCollections();
deviceCollections.removeWhere((element) => !element.shouldBackup);
@@ -424,7 +423,7 @@ class RemoteSyncService {
}
if (localIDsToSync.isEmpty) {
- if (shouldLogSyncRecovery) {
+ if (flagService.syncRecoveryDiagnostics) {
_logger.info(
"[${deviceCollection.name}] upload-prep empty: "
"pathID=${deviceCollection.id} mappedFromPath=0",
@@ -489,7 +488,7 @@ class RemoteSyncService {
"fileSynced ${fileFoundForLocalIDs.length}",
);
}
- if (shouldLogSyncRecovery) {
+ if (flagService.syncRecoveryDiagnostics) {
final int mappedCount = localIDsToSync.length;
final int postFilterCount = localIDsToSync.length;
final int missingFileRows =