osu/osu.Game
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
..
Audio
Beatmaps Merge pull request #25167 from peppy/fix-circle-radius 2023-10-20 20:59:53 +02:00
Collections
Configuration Persist the state of "show speed changes" between editor sessions 2023-10-17 16:01:02 +09:00
Database Add backwards migration of catch dash binding 2023-10-17 09:43:40 +02:00
Extensions Bypass `Parent` nullability checks for now 2023-10-17 17:48:45 +09:00
Graphics Do not revert to default value when double-clicking disabled slider 2023-10-26 12:11:26 +02:00
IO Fix various other inspections 2023-10-17 17:48:51 +09:00
IPC
Input Add ability to quick retry using Ctrl-R 2023-10-26 21:26:26 +09:00
Localisation
Models
Online Fix various other inspections 2023-10-17 17:48:51 +09:00
Overlays Remove nullable disable 2023-10-23 13:29:46 +03:00
Performance
Properties
Replays
Rulesets Fix catch distance snap provider not hiding slider properly 2023-10-26 15:46:32 +02:00
Scoring
Screens Fix quick retry immediately after completion marking score as failed 2023-10-27 12:17:03 +02:00
Skinning Merge branch 'master' into velocity-based-ball-animation 2023-10-25 14:01:19 +09:00
Storyboards Bypass `Parent` nullability checks for now 2023-10-17 17:48:45 +09:00
Tests Merge pull request #25157 from peppy/spinner-anti-cheese-final 2023-10-24 08:13:32 +02:00
Updater
Users Add note about `CountryCode` being at parity with `osu_countries` 2023-10-25 13:03:03 +09:00
Utils
.editorconfig
BackgroundDataStoreProcessor.cs
FodyWeavers.xml
OsuGame.cs
OsuGameBase.cs
OsuGameBase_Importing.cs
PerformFromMenuRunner.cs
osu!.res
osu.Game.csproj Fix iOS AOT compilation failure due to SharpCompress library upgrade 2023-10-26 17:42:28 +09:00