1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 08:07:24 +08:00
osu-lazer/osu.Game/Screens/Play
Bartłomiej Dach 86a8ab6db6
Fix quick retry immediately after completion marking score as failed
Closes https://github.com/ppy/osu/issues/25247.

The scenario involved here is as follows:

1. User completes beatmap by hitting all notes.
2. `checkScoreCompleted()` determines completion, and calls
   `progressToResults(withDelay: true)`.
3. `progressToResults()` schedules `resultsDisplayDelegate`, which
   includes a call to `prepareAndImportScoreAsync()`, a second in the
   future.
4. User presses quick retry hotkey.
   This calls `Player.Restart(quickRestart: true)`,
   which invokes `Player.RestartRequested`,
   which in turn calls `PlayerLoader.restartRequested(true)`,
   which in turn causes `PlayerLoader` to make itself current,
   which means that `Player.OnExiting()` will get called.
5. `Player.OnExiting()` sees that `prepareScoreForDisplayTask` is null
   (because `prepareAndImportScoreAsync()` - which sets it -
   is scheduled to happen in the future), and as such assumes that
   the score did not complete. Thus, it marks the score as failed.
6. `Player.Restart()` after invoking `RestartRequested` calls
   `PerformExit(false)`, which then will unconditionally call
   `prepareAndImportScoreAsync()`. But the score has already been marked
   as failed.

The flow above can be described as "convoluted", but I'm not sure I have
it in me right now to try and refactor it again. Therefore, to fix,
switch the `prepareScoreForDisplayTask` null check in
`Player.OnExiting()` to check `GameplayState.HasPassed` instead, as it
is not susceptible to the same out-of-order read issue.
2023-10-27 12:17:03 +02:00
..
Break Fix valueText being replaced even if current is not binding to anything 2023-08-02 09:40:22 -07:00
HUD Fix health bar animating when it shouldn't be 2023-10-16 13:12:04 +09:00
PlayerSettings Change offset calibration control to adjust for all difficulties of the current beatmap set 2023-07-19 17:13:19 +09:00
ArgonKeyCounter.cs Adjust animations slightly 2023-06-06 14:42:42 +09:00
ArgonKeyCounterDisplay.cs Restructure key counters to use a common flow 2023-04-25 21:37:19 +09:00
BeatmapMetadataDisplay.cs Refactor IWorkingBeatmap.Background to GetBackground() 2023-06-08 16:19:32 +09:00
BreakOverlay.cs Fix valueText being replaced even if current is not binding to anything 2023-08-02 09:40:22 -07:00
BreakTracker.cs Partial everything 2022-11-27 00:00:27 +09:00
ComboEffects.cs Replace various local implementations of rewinding checks with new property 2023-07-07 15:21:24 +09:00
DimmableStoryboard.cs Partial everything 2022-11-27 00:00:27 +09:00
EpilepsyWarning.cs Partial everything 2022-11-27 00:00:27 +09:00
FailAnimationContainer.cs Rename FailAnimation to FailAnimationContainer 2023-10-08 00:39:30 +09:00
FailOverlay.cs Adapt changes to fit master 2023-05-27 12:29:14 +02:00
GameplayClockContainer.cs Adjust comment to match current behaviour 2023-10-10 22:54:19 +09:00
GameplayClockExtensions.cs Rename GameplayAdjustments -> AdjustmentsFromMods 2022-09-08 17:14:06 +09:00
GameplayMenuOverlay.cs GameplayMenuOverlay.cs: add translatable strings for Retry count: and Song progress: 2023-05-27 12:47:05 +02:00
GameplayState.cs Fix TestSceneReplayRecorder not using score provided by gameplay state 2022-07-25 05:21:27 +03:00
HotkeyExitOverlay.cs Automated pass 2023-06-24 01:00:03 +09:00
HotkeyRetryOverlay.cs Automated pass 2023-06-24 01:00:03 +09:00
HUDOverlay.cs Merge branch 'master' into leaderboard-toggle 2023-08-10 22:50:55 +02:00
IGameplayClock.cs Expose rewinding state of IGameplayClocks 2023-07-06 19:08:42 +09:00
ILocalUserPlayInfo.cs Automated pass 2023-06-24 01:00:03 +09:00
MasterGameplayClockContainer.cs Rename methods to not mention "source clock" anymore 2023-10-26 19:38:52 +02:00
OffsetCorrectionClock.cs Split OffsetCorrectionClock out of MasterGameplayClockContainer 2022-08-18 18:54:10 +09:00
PauseOverlay.cs Actually use paused header 2023-05-29 10:24:59 +09:00
Player.cs Fix quick retry immediately after completion marking score as failed 2023-10-27 12:17:03 +02:00
PlayerConfiguration.cs Automated pass 2023-06-24 01:00:03 +09:00
PlayerLoader.cs Remove dead code which was only there for the exit-specific scenario 2023-10-12 19:27:35 +09:00
ReplayPlayer.cs Allow autoplay to fail 2023-07-13 13:41:35 +09:00
ReplayPlayerLoader.cs Automated pass 2023-06-24 01:00:03 +09:00
ResumeOverlay.cs Partial everything 2022-11-27 00:00:27 +09:00
RoomSubmittingPlayer.cs Partial everything 2022-11-27 00:00:27 +09:00
SaveFailedScoreButton.cs Add FireAndForget to stray Task.Run 2023-06-21 17:48:55 +09:00
ScreenSuspensionHandler.cs Partial everything 2022-11-27 00:00:27 +09:00
ScreenWithBeatmapBackground.cs Fix song select potentially updating background parameters when not the current screen 2023-02-16 18:45:22 +09:00
SkipOverlay.cs Fix various other inspections 2023-10-17 17:48:51 +09:00
SoloPlayer.cs Silence a few remaining nullability warnings 2023-07-04 22:39:26 +02:00
SoloSpectator.cs Rename spectator-specific settings to more generic (with backwards migration) 2023-09-18 14:56:06 +02:00
SoloSpectatorPlayer.cs Make user activity class names more specific 2023-02-12 12:32:17 -08:00
SpectatorPlayer.cs Partial everything 2022-11-27 00:00:27 +09:00
SpectatorPlayerLoader.cs Automated pass 2023-06-24 01:00:03 +09:00
SpectatorResultsScreen.cs Manual fixes to reduce warnings to zero 2023-06-24 01:52:53 +09:00
SquareGraph.cs Make layout readonly 2023-05-13 11:37:56 +02:00
SubmittingPlayer.cs Ensure score submission attempt completion before notifying spectator server when exiting play early 2022-12-21 22:23:26 +01:00