ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.3k stars 2.27k forks source link

Guard against data loss in editor #24031

Open peppy opened 1 year ago

peppy commented 1 year ago

To avoid user error, we should probably disallow saving when a beatmap goes from having objects to having no object.

Alternative would be to offer a save history per beatmap (ie. last x saves or similar).

Adding a confirm on exit should be easy, but will require special attention for the confirmExitWithSave scenario.

Discussed in https://github.com/ppy/osu/discussions/24020

Originally posted by **whatwillweget** June 24, 2023 Today, I was mapping an beatmap in osu!lazer (2023.621.0) and suddenly the beatmap was corrupted after saving, lost all data for one difficulty and reverted data for an another difficulty, which costs hours of work. ~~To fix this issue, auto-backups can save the data lost if the beatmap has been corrupted. Auto-backups are also useful to revert the beatmap back to the old version when a mapper is unsatisfied with the beatmap.~~
get2day commented 1 year ago

For some reason, I was lucky enough to experience on only my local beatmap, but in #24034 was terribly worse, which I remembered that the error was similar to mine.

peppy commented 1 year ago

We should also probably confirm if scores are going to be deleted due to a save operation (see https://github.com/ppy/osu/discussions/24047).

cihe13375 commented 1 year ago

Two additional features that I feel would be helpful on this topic:

1) create auto backups of the beatmap every X minutes/operations, and the user may recover from those backups when they want 2) try to create a backup before exit when osu! knows it will crash (unhandled exceptions). I don't know if this is possible though.

The reason is that even if osu! itself may be designed with stability in mind, it cannot prevent accidental crash due to external factors like hardware or OS issues (In my own experience, it's mostly about the GPU watchdog timeout caused by some Folding@Home work units; it does not affect normal use or FAH itself, but is likely a reason for osu! crashing on my PC, both on lazer and stable)

bdach commented 1 year ago

it cannot prevent accidental crash due to external factors like hardware or OS issues (In my own experience, it's mostly about the GPU watchdog timeout caused by some Folding@Home work units; it does not affect normal use or FAH itself, but is likely a reason for osu! crashing on my PC, both on lazer and stable)

If anything of this sort is going on then trying to anticipate it and save just-in-time-before-crash is a fool's errand, I'd say. Auto-backups are possibly okay, though, although that's probably not in the scope of this issue.