Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: setProgress should not exit with an error when the item progress is not managed. #374

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/libsyncengine/progress/progressinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
LOGW_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)) {
Expand All @@ -140,7 +142,9 @@ bool ProgressInfo::setProgressComplete(const SyncPath &path, const SyncFileStatu

const auto it = _currentItems.find(normalizedPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two blocks looks identical. Refactoring to remove redundancy would let us write a fix in a single place.

if (it == _currentItems.end() || it->second.empty()) {
return false;
LOGW_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();
Expand Down
Loading