Bug 301817

Summary: [Data loss] KMyMoney corrupts its file when freezing
Product: [Applications] kmymoney Reporter: Unknown <null>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED DUPLICATE    
Severity: major CC: null, onet.cristian
Priority: NOR    
Version: 4.6.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Unknown 2012-06-13 15:15:43 UTC
Because of a pie-chart drawing bug inside, the program slowed down very noticeable. I had autosave turned on for every 3 minutes.

While the program had been still drawing the report, an autosave occurred and could not finish. After that I fed up and killed the program because of its slowness.

On the next reopening I realised that the only thing it left was a 0-byte data file… Half year of my financial data lost forever.

Please, implement that (I think) very easy fix that before save the program copies the sane file next to itself and after the successful operation it deletes that. I know there's a "how many backups do you want to make" option but it differs.
This one guards you against program faults (like this one) and the spinbox protects you from your faults (accidentally deleted something etc.).

Even in an office suit (Word, LO) this feature is implemented. It should be compulsory for a financial program.

Reproducible: Always
Comment 1 Thomas Baumgart 2012-06-13 18:13:49 UTC
I understand that this is a very bad behavior and should be fixed. I have a questions though, because we use the KSaveFile object which should provide the result  as you suggest though using a different method: it writes the file to a temp file and renames it if the save was successful.

Now to the question: do you use GPG encryption?
Comment 2 Unknown 2012-06-13 22:42:29 UTC
That solution is also perfect as soon as the move operation is atomic from the program's view point.

No, I don't use GPG.
Comment 3 Cristian Oneț 2014-07-31 09:50:36 UTC

*** This bug has been marked as a duplicate of bug 327663 ***