Safety first! Temp file before saving

Bug #671324 reported by Mario B.
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenShot Video Editor
Fix Released
High
Unassigned

Bug Description

If one saves a session and OpenShot crashes while writing the project file, everything will be destroyed. A previous (good) version will be overwritten. This is what happend to me.
Since I lost a whole day of work this week, I came to the following conclusion. When saving a project, OpenShot should write a temporary file first. Then, if the file has been written without errors, it can be copied to the "real" project file. After that (and if there wasn't an error) the temp file can be removed safely. If OpenShot should crash, you've got at least the last good save state.

Another method would be to write a temp file when opening a project. By saving the project, the actions will be committed to the "real" project file. After that the temp file can be removed.

Please add this to the wishlist. Thanks.

Revision history for this message
Olivier Girard (eolinwen) wrote :

Very interesting suggestions for an unlucky man :)
Thanks.

Changed in openshot:
importance: Undecided → Wishlist
milestone: none → 1.3.0
Andy Finch (fincha)
Changed in openshot:
status: New → In Progress
moimael (moimael)
Changed in openshot:
importance: Wishlist → High
Revision history for this message
Jonathan Thomas (jonoomph) wrote :

I have just committed some code, which autosaves on an interval or before each playback / preview attempt. The way that OpenShot saves it's actual project file is with the cpickle Python method. There is no easy way to save it to a temp file, because if it seg faults the Python interpreter, OpenShot closes immediately with no way to stop it.

So, I think our new autosave code is a big step in the right direction.

Changed in openshot:
status: In Progress → Fix Committed
moimael (moimael)
Changed in openshot:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.