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

Check ranked state when retrieving user best scores #258

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Apr 15, 2024

DatabaseHelper.GetUserBestScoreFor() did not check the value of ranked for the rows it was looking through to find the user's best score, which means that it could wrongly select an unranked score (i.e. one set back when a map was in qualified).

This potentially impacts: user total ranked score and user total letter rank counts in all rulesets (including mania keymodes). Please see added test cases for explanation as to how. The worst case scenario is that the user's real best score would not be counted towards those stats because of an unranked score with a higher total.

I don't believe there to be a sane path for retroactively fixing that (if it ever even happened, which I don't know - I only realised this could be a possibility when working on medals / #254). Potentially reprocessing those scores could work, if they can be located easily - which is going to be the bigger problem here.

Copy link
Contributor

@smoogipoo smoogipoo left a comment

Choose a reason for hiding this comment

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

At face value this looks correct.

@smoogipoo smoogipoo requested a review from peppy April 15, 2024 12:17
@peppy peppy merged commit bd28321 into ppy:master Apr 15, 2024
3 checks passed
@bdach bdach deleted the fix-ranked-flag-not-checked branch April 15, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

3 participants