From 0021434a62ea4aea65281957b9ac5dff4ba4121f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 1 Sep 2025 17:54:24 +0900 Subject: [PATCH 1/2] Fix cancellation token not actually being used --- osu.Game/Screens/SelectV2/SongSelect.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index ef00064ced..b2dc8404e4 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -1011,7 +1011,7 @@ namespace osu.Game.Screens.SelectV2 lastLookupResult.Value = BeatmapSetLookupResult.InProgress(); onlineLookupCancellation = new CancellationTokenSource(); - currentOnlineLookup = onlineLookupSource.GetBeatmapSetAsync(beatmapSetInfo.OnlineID); + currentOnlineLookup = onlineLookupSource.GetBeatmapSetAsync(beatmapSetInfo.OnlineID, onlineLookupCancellation.Token); currentOnlineLookup.ContinueWith(t => { if (t.IsCompletedSuccessfully) From 9d0043d03bf74b5f0f86aa6018c2d3cd212e0cde Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 1 Sep 2025 17:58:41 +0900 Subject: [PATCH 2/2] Cancel underlying web request on local cancellation of lookup request --- osu.Game/Screens/SelectV2/RealmPopulatingOnlineLookupSource.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/SelectV2/RealmPopulatingOnlineLookupSource.cs b/osu.Game/Screens/SelectV2/RealmPopulatingOnlineLookupSource.cs index 486dfbe255..832095058a 100644 --- a/osu.Game/Screens/SelectV2/RealmPopulatingOnlineLookupSource.cs +++ b/osu.Game/Screens/SelectV2/RealmPopulatingOnlineLookupSource.cs @@ -43,6 +43,8 @@ namespace osu.Game.Screens.SelectV2 var request = new GetBeatmapSetRequest(id); var tcs = new TaskCompletionSource(); + token.Register(() => request.Cancel()); + // async request success callback is a bit of a dangerous game, but there's some reasoning for it. // - don't really want to use `IAPIAccess.PerformAsync()` because we still want to respect request queueing & online status checks // - we want the realm write here to be async because it is known to be slow for some users with large beatmap collections