From 196b28115ebf327d9b24edc32eb6ba899cfd8b8d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 26 Aug 2025 17:51:02 +0900 Subject: [PATCH] Fix playlist leaderboard provider potentially inserting local user in wrong order Due to `Perform` being used from a BDL method in conjunction with `Success` (which is scheduled to the *update* thread), there was a chance that the order of execution would be not quite as intended. To rectify, let's not use `Success` and just continue with synchronous flow. --- .../Leaderboards/PlaylistsGameplayLeaderboardProvider.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Select/Leaderboards/PlaylistsGameplayLeaderboardProvider.cs b/osu.Game/Screens/Select/Leaderboards/PlaylistsGameplayLeaderboardProvider.cs index c60e06939b..3044e1a0e2 100644 --- a/osu.Game/Screens/Select/Leaderboards/PlaylistsGameplayLeaderboardProvider.cs +++ b/osu.Game/Screens/Select/Leaderboards/PlaylistsGameplayLeaderboardProvider.cs @@ -37,7 +37,11 @@ namespace osu.Game.Screens.Select.Leaderboards var scoresToShow = new List(); var scoresRequest = new IndexPlaylistScoresRequest(room.RoomID!.Value, playlistItem.ID); - scoresRequest.Success += response => + api.Perform(scoresRequest); + + var response = scoresRequest.Response; + + if (response != null) { isPartial = response.Scores.Count < response.TotalScores; @@ -50,8 +54,7 @@ namespace osu.Game.Screens.Select.Leaderboards if (response.UserScore != null && response.Scores.All(s => s.ID != response.UserScore.ID)) scoresToShow.Add(new GameplayLeaderboardScore(response.UserScore, tracked: false, GameplayLeaderboardScore.ComboDisplayMode.Highest)); - }; - api.Perform(scoresRequest); + } if (gameplayState != null) {