Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
peppy opened this issue Oct 11, 2023 · 3 comments
Open

Comments

@peppy
Copy link
Member

peppy commented Oct 11, 2023

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 peppy moved this from Needs discussion to Needs implementation in Path to osu!(lazer) ranked play Oct 11, 2023
@peppy peppy self-assigned this Oct 25, 2023
@peppy
Copy link
Member Author

peppy commented Oct 25, 2023

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 peppy moved this from Needs implementation to In Progress in Path to osu!(lazer) ranked play Oct 25, 2023
@peppy peppy removed their assignment Nov 14, 2023
@peppy peppy moved this from In Progress to In Review in Path to osu!(lazer) ranked play Nov 14, 2023
@peppy peppy moved this from In Review to Needs implementation in Path to osu!(lazer) ranked play Nov 14, 2023
@peppy
Copy link
Member Author

peppy commented Nov 14, 2023

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

@peppy
Copy link
Member Author

peppy commented Dec 20, 2023

Moving out of project for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant