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

Fix overall status computation #10536

Merged
merged 1 commit into from
Mar 1, 2023
Merged

Fix overall status computation #10536

merged 1 commit into from
Mar 1, 2023

Conversation

TheOneRing
Copy link
Contributor

Please read carefully, I'm not sure what the whole logic here was meant to do (It`s my code).
Fixes: #9270

@TheOneRing TheOneRing requested a review from a team February 24, 2023 15:15
Copy link
Contributor

@fmoc fmoc left a comment

Choose a reason for hiding this comment

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

I guess the new logic is reasonable. I found a problem, please fix. I'll re-review afterwards.

}
break;
auto status = f->syncPaused() ? SyncResult::Paused : f->syncResult().status();
if (SyncResult::Undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You probably want to compare against status.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wow ... 🙈

Copy link
Contributor

@dragotin dragotin left a comment

Choose a reason for hiding this comment

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

The fix is nice, but why and how does that solve the problem described in the Bugreport?

@TheOneRing TheOneRing requested a review from fmoc March 1, 2023 10:16
@TheOneRing
Copy link
Contributor Author

Before status done was taking precedence over status in progress

@TheOneRing TheOneRing requested a review from dragotin March 1, 2023 10:17
status = SyncResult::Problem;
}
if (status > _overallStatus.status()) {
_overallStatus.setStatus(status);
Copy link
Contributor

Choose a reason for hiding this comment

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

This somehow looks as if the status can never go to "lower" values any more, because of the if statement. In the code before it could. Or is it reset elsewhere again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The commutation happens on a temporary so we always start with undefined.

Copy link
Contributor

Choose a reason for hiding this comment

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

Undefined is currently the smallest value. The order is documented above the definition. This should be fine.

@TheOneRing TheOneRing force-pushed the work/overall_status branch from f2b3418 to eba85e4 Compare March 1, 2023 12:50
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

status = SyncResult::Problem;
}
if (status > _overallStatus.status()) {
_overallStatus.setStatus(status);
Copy link
Contributor

Choose a reason for hiding this comment

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

Undefined is currently the smallest value. The order is documented above the definition. This should be fine.

@TheOneRing TheOneRing merged commit 6b108ee into master Mar 1, 2023
@delete-merged-branch delete-merged-branch bot deleted the work/overall_status branch March 1, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Text and icon in tray menu stays wrong
3 participants