OpenNBS / OpenNoteBlockStudio

An open-source Minecraft music maker.
https://opennbs.org/
MIT License
728 stars 50 forks source link

If an autosave occurs while a window is open, OpenNBS essentially freezes #442

Open CreeperPookie opened 3 months ago

CreeperPookie commented 3 months ago

Describe the bug If you open an inner window (set pitch, velocity, etc) and an autosave occurs, the popup closes but the background stays, essentially locking you out of everything. Because it still saves though, it is possible to restart it without losing any progress.

To Reproduce Steps to reproduce the behavior:

  1. Open a new song

  2. Ensure autosave is on and optionally, decrease autosave delay as low as possible

  3. Save the song as an NBS file

  4. Add a note to the song

  5. Select the note and open an action GUI on it (pitch, velocity, etc)

  6. Wait for the autosave to occur (this is why you might want to decrease autosave delay)

  7. See error

Expected behavior I'd say the most optimal solution would be to do nothing, and keep the GUI open when saving as-is.

Video

https://github.com/OpenNBS/OpenNoteBlockStudio/assets/61175748/069520f4-0a45-4baa-9d19-115f61702fc0

Additional context I was able to find one reference to this in #107, but that seemed to be related to selecting and deselecting notes with somewhat precise timing. However, they did mention they had a GUI open during a save operation, which could have also caused this issue.

Bentroen commented 2 months ago

Thanks for your investigation and for mentioning the related issue! This exact issue was addressed for a hidden auto-recovery mechanism that was supposed to prevent work loss if NBS happened to quit unexpectedly. I'd believed that the fix to that issue would also address auto-save (calling the save_song function with a backup flag set to 1 wouldn't clear your selection + the macro dialogs would never be partially rendered based on your selection content, preventing you from closing them), but since it's still an issue, the mechanism probably wasn't applied to the configurable auto-save.

CreeperPookie commented 2 months ago

@Bentroen I also want to add that I was also able to recreate the deselection of notes bug from #107 when saving! (autosave and the save button) I know #107 was for the auto-recovery feature, maybe these bugs are related (maybe it used the same internal save code or something)

chenxi050402 commented 2 months ago

if you find yourself softlocked in onbs, try pressing F3 + C, it will work in most situations

CreeperPookie commented 2 months ago

That should definitely be in a FAQ or something, because that's so useful! I wish I knew about that before lol