Check ranked state when retrieving user best scores #258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DatabaseHelper.GetUserBestScoreFor()
did not check the value ofranked
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.