From 0da95111bb34a57aa05fe32f027f063b46c720e6 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Tue, 10 May 2022 13:12:41 +0530 Subject: [PATCH 1/3] Log only when files are updated --- lib/services/local_sync_service.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/services/local_sync_service.dart b/lib/services/local_sync_service.dart index fa8629767..53f0a88d9 100644 --- a/lib/services/local_sync_service.dart +++ b/lib/services/local_sync_service.dart @@ -231,7 +231,9 @@ class LocalSyncService { updatedFiles.removeWhere((file) => editedFileIDs.contains(file.localID)); updatedFiles .removeWhere((file) => downloadedFileIDs.contains(file.localID)); - _logger.info(updatedFiles.length.toString() + " files were updated."); + if (updatedFiles.isNotEmpty) { + _logger.info(updatedFiles.length.toString() + " files were updated."); + } for (final file in updatedFiles) { await _db.updateUploadedFile( file.localID, From e4a52845ae533ddf86775f1a9302c5708ea2554d Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Tue, 10 May 2022 13:15:11 +0530 Subject: [PATCH 2/3] switch to new endpoint for fileUpdate --- lib/utils/file_uploader.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utils/file_uploader.dart b/lib/utils/file_uploader.dart index f7fef534a..068d99e0f 100644 --- a/lib/utils/file_uploader.dart +++ b/lib/utils/file_uploader.dart @@ -556,8 +556,8 @@ class FileUploader { } }; try { - final response = await _dio.post( - Configuration.instance.getHttpEndpoint() + "/files", + final response = await _dio.put( + Configuration.instance.getHttpEndpoint() + "/files/update", options: Options( headers: {"X-Auth-Token": Configuration.instance.getToken()}), data: request, From fa6d3c3eb3411fcf567fa1dcc257fb3dd088b467 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta Date: Tue, 10 May 2022 14:02:46 +0530 Subject: [PATCH 3/3] Update local_sync_service.dart --- lib/services/local_sync_service.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/local_sync_service.dart b/lib/services/local_sync_service.dart index 53f0a88d9..29b4f0ba6 100644 --- a/lib/services/local_sync_service.dart +++ b/lib/services/local_sync_service.dart @@ -232,7 +232,7 @@ class LocalSyncService { updatedFiles .removeWhere((file) => downloadedFileIDs.contains(file.localID)); if (updatedFiles.isNotEmpty) { - _logger.info(updatedFiles.length.toString() + " files were updated."); + _logger.info(updatedFiles.length.toString() + " local files were updated."); } for (final file in updatedFiles) { await _db.updateUploadedFile(