osu-server-spectator icon indicating copy to clipboard operation
osu-server-spectator copied to clipboard

Simplify post-score-completion process by sending score ID from client

Open peppy opened this issue 2 years ago • 3 comments

In theory, we should be able to do something like this:

diff --git a/osu.Game/Screens/Play/SubmittingPlayer.cs b/osu.Game/Screens/Play/SubmittingPlayer.cs
index 5fa6508a31..663ea9ab81 100644
--- a/osu.Game/Screens/Play/SubmittingPlayer.cs
+++ b/osu.Game/Screens/Play/SubmittingPlayer.cs
@@ -131,7 +131,8 @@ protected override async Task PrepareScoreForResultsAsync(Score score)
             score.ScoreInfo.Date = DateTimeOffset.Now;
 
             await submitScore(score).ConfigureAwait(false);
-            spectatorClient.EndPlaying(GameplayState);
+            long onlineId = score.ScoreInfo.OnlineID;
+            spectatorClient.EndPlaying(GameplayState, onlineId);
         }
 
         [Resolved]

This would hopefully avoid the polling resolution process we have in place for replay uploads. We should be able to trust the client's returned ID as we can cross-check with the solo_score_tokens table.

peppy avatar Oct 11 '23 10:10 peppy

As an exercise, I implemented this change client/server. It looks like it will work, and cleans up some of the code. It can likely be further cleaned up.

As touched on on discord, I'm not sure if we want to keep the client-side flow synchronous (this change relies on it). This requires further discussion, I'd be interested in hearing other's opinions.

https://github.com/ppy/osu-server-spectator/compare/master...peppy:osu-server-spectator:post-score-completion-simplification?expand=1 https://github.com/ppy/osu/compare/master...peppy:osu:post-score-completion-simplification?expand=1

@bdach you mentioned working on retry logic, which will likely tie into this, so please peruse the above and see how it slots into the equation when you do.

I'll leave myself assigned to this since I now have a good idea of how it can work, but won't be putting any more time into this just yet.

peppy avatar Oct 25 '23 10:10 peppy

Unassigning myself from this for now, as it's going to be intertwined with score submit retry (see #24609).

peppy avatar Nov 14 '23 02:11 peppy

Moving out of project for now.

peppy avatar Dec 20 '23 06:12 peppy