Autosave should save even if the file is unchanged since the last save to avoid data loss during crash on save
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Inkscape only autosaves a copy if no changes have been made to the file since it was last saved.
If Inkscape dumps core (for example) when saving the file, most of the file may be lost and no autosaved backup be available. That is, saving frequently increases the risk of massive data loss in this scenario.
I had a 15M file. Autosave was set for 10 minute intervals. When I saved the document, Inkscape dumped core. My 15M file is now just over 6M. It opens, but most of it is missing.
No autosave had been done in the previous 10 minutes because I saved the file too frequently during that time.
I cannot get any useful information about the core dump: Inkscape does not usually crash when I save. I have no idea what triggered it. There is not even the usual trace in the journal (just a thread number) and I don't know if systemd actually saved anything useful about the crash.
But I do say that Inkscape should autosave the file even if it is unchanged, so that a 10-minute autosave interval really does mean that you don't lose more than 10 minutes of work.
Version: 0.92.3
Distro: Arch Linux
Release: 6 (distro version in full: 0.92.3-6)
Let me try to simplify the problem:
1. Open file
[optional: 2. wait x minutes]
3. Make some tiny change
4. Save (within < 10 minutes)
5. Assume that inkscape crashes in the middle of saving the file.
Bug: The file is corrupted and you have no autosave or whatever to restore your file.
Expected: At least the original file is saved somewhere.
Because step 2 can be omitted, just changing the autosave condition does not help in general!
The solution would rather be to atomically write the whole file at once, which is painful to implement in a cross-platform way (Linux: overwrite- by-rename, Windows: no idea, after reading https:/ /stackoverflow. com/questions/ 167414/ is-an-atomic- file-rename- with-overwrite- possible- on-windows I am rather confused)
Workarounds could be:
- trigger an autosave before every save. The autosave is useless, but it will trigger the crash.
- trigger an autosave on every open. This is probably more annoying if you use inkscape mostly for viewing and not for editing.