Opened 5 years ago
Last modified 5 years ago
#19567 new enhancement
When restoring an auto-saved data layer, keep the file around
Reported by: | stanton | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | autosave | Cc: |
Description
When restoring an automatically saved data layer after JOSM has crashed, JOSM loads the data layer and deletes the backup file, leaving the user without a backup until the next autosave. If JOSM (or the system) hangs or crashes in that timespan, the data is lost.
This almost hit me recently: I was having issues with loading data layers from files, as doing so would cause JOSM to crash (happened a few times but seems to have gone away eventually; I was never able to identify what triggered it). I had to kill JOSM as it stopped responding. I then made a copy of the autosaved file and restarted JOSM. It prompted me to restore the data layer, then crashed and the autosaved file was gone. (I was eventually able to load the copy I had made after restarting JOSM.)
As the subject line says, this ticket is not about why JOSM crashed upon loading certain files—we can never rule out that JOSM (or the system) will crash or hang. The bottom line is that JOSM should treat autosave files as containing unsaved changes and never delete them unless one of the following is true:
- The file contains only data downloaded from the API, with no local changes.
- All changes have been saved or uploaded.
- The user has chosen to discard the data layer (closed JOSM), despite unsaved changes.
- A new autosave file has been created for the layer.