1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 21:47:28 +08:00
osu-lazer/osu.Game/Screens
Bartłomiej Dach 6948035a3c
Ensure score submission attempt completion before notifying spectator server when exiting play early
When a `SubmittingPlayer` gameplay session ends with the successful
completion of a beatmap, `PrepareScoreForResultsAsync()` ensures that
the score submission request is sent to and responded to by osu-web
before calling `ISpectatorClient.EndPlaying()`.

While previously this was mostly an implementation detail, this becomes
important when considering that more and more server-side flows (replay
upload, notifying about score processing completion) hook into
`EndPlaying()`, and assume that by the point that message arrives at
osu-spectator-server, the score has already been submitted and has been
assigned a score ID that corresponds to the score submission token.

As it turns out, in the early-exit path (when the user exits the play
midway through, retries, or just fails), the same ordering guarantees
were not provided. The score's submission ran concurrently to the
spectator client `EndPlaying()` call, therefore creating a network
race. osu-server-spectator components that implciitly relied on the
ordering provided by the happy path, could therefore fail to unmap the
score submission token to a score ID.

Note that as written, the osu-server-spectator replay upload flow is
not really affected by this, as it self-corrects by essentially polling
the database and trying to unmap the score submission token to a score
ID for up to 30 seconds. However, this change would have the benefit of
reducing the polls required in such cases to just one DB retrieval.
2022-12-21 22:23:26 +01:00
..
Backgrounds Partial everything 2022-11-27 00:00:27 +09:00
Edit Use MaxBy in all locations that can and update inspection level to match dotnet-build 2022-12-19 16:47:10 +09:00
Import Merge branch 'master' into update-framework 2022-11-26 16:19:36 +01:00
Menu fix typo in today's tip 2022-12-07 17:47:37 +03:00
OnlinePlay Use MaxBy in all locations that can and update inspection level to match dotnet-build 2022-12-19 16:47:10 +09:00
Play Ensure score submission attempt completion before notifying spectator server when exiting play early 2022-12-21 22:23:26 +01:00
Ranking Clamp SFX panning on results screen 2022-12-16 17:19:07 +09:00
Select Perform rewind with right click only if cursor didn't leave the button 2022-12-05 23:38:45 +03:00
Spectate Partial everything 2022-11-27 00:00:27 +09:00
Utility Fix the MOTHERLOAD of undetected issues that are now visible thanks to net6.0 2022-12-16 18:16:26 +09:00
BackgroundScreen.cs Partial everything 2022-11-27 00:00:27 +09:00
BackgroundScreenStack.cs Partial everything 2022-11-27 00:00:27 +09:00
IHandlePresentBeatmap.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
IHasSubScreenStack.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
IOsuScreen.cs Keep cursor hiding feature to gameplay screens for now 2022-10-20 03:44:58 +03:00
IPerformFromScreenRunner.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
Loader.cs Partial everything 2022-11-27 00:00:27 +09:00
OsuScreen.cs Partial everything 2022-11-27 00:00:27 +09:00
OsuScreenDependencies.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
OsuScreenStack.cs Partial everything 2022-11-27 00:00:27 +09:00
ScorePresentType.cs Automated #nullable processing 2022-06-17 16:37:17 +09:00
ScreenWhiteBox.cs Partial everything 2022-11-27 00:00:27 +09:00
StartupScreen.cs Partial everything 2022-11-27 00:00:27 +09:00