TagStudioDev / TagStudio

A User-Focused Photo & File Management System
GNU General Public License v3.0
4.63k stars 350 forks source link

[Bug]: Computer shutdowns and crashes will delete all fields in open libraries #320

Open samuellieberman opened 1 month ago

samuellieberman commented 1 month ago

Checklist

TagStudio Version

Alpha 9.3.0

Operating System & Version

Microsoft Windows 11 Home 10.0.22631 Build 22631

Description

If my computer ever shuts down or crashes while running TagStudio, then every field and tag in my library is missing when I reopen TagStudio. Discord user Septagram has reported the same issue.

Expected Behavior

I should only ever lose the progress from my current TagStudio session, at worst.

Steps to Reproduce

  1. I duplicated a test library in another folder.
  2. I opened TagStudio by double clicking TagStudio/tagstudio/tag_studio.py.
  3. Clicked File -> Open/Create Library and selected the duplicate library.
  4. I added a single tag to a single file.
  5. On my computer, I clicked Start -> Power -> Restart without closing TagStudio.
  6. I reopened TagStudio by double clicking TagStudio/tagstudio/tag_studio.py.
  7. Clicked File -> Open/Create Library and selected the duplicate library.
  8. Every field is now gone.

Logs

No response

CyanVoxel commented 1 month ago

My guess is that the shutdown process tells TagStudio to close cleanly, which initiates the "save on exit" functionality but then gets interrupted by the shutdown itself occurring. I would think that the shutdown process would respect the disk writing process, but then maybe not.

As for crashes, this is odd because if TagStudio is closed prematurely (like during a crash) then the save operation is never started, and it never has a chance to overwrite the file that's already on disk. If this is an issue though then it may be related to the same shutdown one.

Also, I noticed you listed the version as 9.1.0 despite checking the "I am using an up-to-date version" box. Is this correct or a typo?

samuellieberman commented 1 month ago

Also, I noticed you listed the version as 9.1.0 despite checking the "I am using an up-to-date version" box. Is this correct or a typo?

Yes, that is a typo. I don't know where I got that from. I have edited the bug report.