From 89e9b5be31e760bfe0820440cb23ffedf8660a34 Mon Sep 17 00:00:00 2001 From: Herve Eruam Date: Tue, 5 Nov 2024 11:07:11 +0100 Subject: [PATCH 1/2] Bug fix: setProgress and setProgressCompleted should not exit with an error when the item progress is not managed. --- src/libsyncengine/progress/progressinfo.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libsyncengine/progress/progressinfo.cpp b/src/libsyncengine/progress/progressinfo.cpp index 824bd13f2..6688a5951 100644 --- a/src/libsyncengine/progress/progressinfo.cpp +++ b/src/libsyncengine/progress/progressinfo.cpp @@ -119,7 +119,9 @@ bool ProgressInfo::setProgress(const SyncPath &path, const int64_t completed) { const auto it = _currentItems.find(normalizedPath); if (it == _currentItems.end() || it->second.empty()) { - return false; + LOG_INFO(Log::instance()->getLogger(), + L"Item not found in ProgressInfo list (normal for ommited operation): " << Utility::formatSyncPath(path)); + return true; } if (const SyncFileItem &item = it->second.front().item(); !shouldCountProgress(item)) { @@ -140,7 +142,9 @@ bool ProgressInfo::setProgressComplete(const SyncPath &path, const SyncFileStatu const auto it = _currentItems.find(normalizedPath); if (it == _currentItems.end() || it->second.empty()) { - return false; + LOG_INFO(Log::instance()->getLogger(), + L"Item not found in ProgressInfo list (normal for ommited operation): " << Utility::formatSyncPath(path)); + return true; } SyncFileItem &item = it->second.front().item(); From 607ebdbd33808de8c86a8270ec147c03c2aef81d Mon Sep 17 00:00:00 2001 From: Herve Eruam Date: Tue, 5 Nov 2024 12:09:33 +0100 Subject: [PATCH 2/2] Fix log --- src/libsyncengine/progress/progressinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsyncengine/progress/progressinfo.cpp b/src/libsyncengine/progress/progressinfo.cpp index 6688a5951..01a4384d1 100644 --- a/src/libsyncengine/progress/progressinfo.cpp +++ b/src/libsyncengine/progress/progressinfo.cpp @@ -119,7 +119,7 @@ bool ProgressInfo::setProgress(const SyncPath &path, const int64_t completed) { const auto it = _currentItems.find(normalizedPath); if (it == _currentItems.end() || it->second.empty()) { - LOG_INFO(Log::instance()->getLogger(), + LOGW_INFO(Log::instance()->getLogger(), L"Item not found in ProgressInfo list (normal for ommited operation): " << Utility::formatSyncPath(path)); return true; } @@ -142,7 +142,7 @@ bool ProgressInfo::setProgressComplete(const SyncPath &path, const SyncFileStatu const auto it = _currentItems.find(normalizedPath); if (it == _currentItems.end() || it->second.empty()) { - LOG_INFO(Log::instance()->getLogger(), + LOGW_INFO(Log::instance()->getLogger(), L"Item not found in ProgressInfo list (normal for ommited operation): " << Utility::formatSyncPath(path)); return true; }