Fix stable scores importing with a LegacyOnlineID
of 0
#33612
Merged
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.
Closes #33435.
The root cause of the issue is that the user's database contained a whole lot of scores with
LegacyOnlineID
of 0, which would trip uposu/osu.Game/Extensions/ModelExtensions.cs
Lines 128 to 129 in 97e6187
as that method would thus consider scores that are not the same as the same because of the zero, which later trips up
osu/osu.Game/Screens/Ranking/SoloResultsScreen.cs
Line 79 in 97e6187
which ends up inserting
Score
into the list several times, which causes the crash.You might remember that I tried to fix this once before in #24794. What I did not realise, however, is that stable can still produce replays that have an online ID of zero in them, because zero is just
default(long)
(reference 1, reference 2), and e.g. scores set offline will have that zero inside.The alternative way of fixing this would be just to change
MatchesOnlineID
to reject zeroes, but I think this is a saner overall direction.