GnuCash
Contact   Instructions
Bug 796100 - Autosave Doesn't Work if Preferences Changed During Data Entry
Summary: Autosave Doesn't Work if Preferences Changed During Data Entry
Status: NEW
Alias: None
Product: GnuCash
Classification: Unclassified
Component: General (show other bugs)
Version: 3.1
Hardware: Other Windows
: Normal major
Target Milestone: future
Assignee: general
QA Contact: general
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-14 08:41 EDT by Robert Chapin
Modified: 2019-07-14 02:09 EDT (History)
5 users (show)

See Also:


Attachments

Description Robert Chapin 2018-05-14 08:41:56 EDT
While testing related bugs, I found that GnuCash 3.1 sometimes does not autosave at all.

This might be related to opening a locked file after a crash.  I suspect the autosave will not fire again unless the user clicks the Save button at least one time.  However, this can still lead to potential data loss over time if the program crashes.
Comment 1 Robert Chapin 2018-05-14 09:46:55 EDT
I found this is not limited to locked files.  I just reopened the program and did not get any autosaves for at least 40 minutes during data entry.

Now I suspect autosaves wont fire any time the program is opened before the user clicks the Save button.
Comment 2 Robert Chapin 2018-05-14 10:58:49 EDT
In addition to above, I've also observed that autosaves will stop semi-randomly while testing with --log gnc.backend.xml=debug

For example, after most recently clicking the Save button, I have files stamped 10:48 AM and 10:49 AM, and then nothing for the next 7 minutes, with autosave interval set to 1 minute.
Comment 3 Robert Chapin 2018-07-26 09:17:24 EDT
Still experiencing this problem with v3.2.  There is no obvious cause or pattern.  It just stops autosaving at random.  The current interval setting is 2 minutes.
Comment 4 Chris Good 2018-07-26 17:26:00 EDT
What version of Windows?
Comment 5 Robert Chapin 2018-07-26 17:27:03 EDT
Windows 10.0.17134.165
Comment 6 Chris Good 2018-07-26 17:40:11 EDT
I haven't noticed this problem in my Win10 GnuCash v3 systems. I have autosave set to the default (I think) 5 minutes. I'll do some testing. I believe an autosave will not occur until unless something has changed, which enables the save button. Please clarify you are not just getting no save because nothing has changed?
Comment 7 Robert Chapin 2018-07-26 17:49:11 EDT
It's running indefinitely unsaved unless I click the Save button.  Or unless autosave is working, which it does sometimes and not others.

Are there any conditions such as file or network errors that would cause this to stop silently until I click Save?  And could it be fixed to just try again at the next interval?
Comment 8 Chris Good 2018-07-26 18:09:59 EDT
Hi Robert,

You haven't quite answered my question. Do you realize that it will not autosave unless you have made a change? I can sort of imply that you know that as you say you can force a save using the save button, but maybe the save button is only enabled because you have just made a change. If you don't change anything, there correctly will be no save done for possibly long periods of time.
Sorry I cannot answer your other questions as I don't currently have time (or possibly the C++ skills). I just want the properly define the problem before I spend time testing.
Comment 9 Robert Chapin 2018-07-26 18:53:25 EDT
Yes
Comment 10 Chris Good 2018-09-22 21:53:04 EDT
Robert, I cannot duplicate this problem with auto save interval set to default 5 minutes or 1 minute in my GnuCash 3.1-3 Win 10.
Do you perhaps have 'Show auto-save confirmation' ticked? (I don't).
There was a recent bug fixed where it would wait a very long time if 'Time to wait for answer' was 0.
Comment 11 Wm 2019-04-02 05:22:49 EDT
Is this bug still current?  I think it should be changed to "Need more info"
Comment 12 Robert Chapin 2019-04-03 09:13:08 EDT
I was able to reproduce this problem in v3.4 as follows:

1. Create a new XML file with the default account hierarchy.
2. Change the autosave interval to 1 minute in Preferences.
3. Begin typing new transactions in the Checking Account.  Continue doing this continuously for 2 minutes.

After those three simple steps I observed these results:

No autosaves had occurred at all.

The file on disk was 4+ minutes old.

The GnuCash title bar showed an asterisk at the beginning, indicating correctly the unsaved changes.

Allowing the program to sit idle for several minutes did not trigger any autosaves.
Comment 13 Robert Chapin 2019-04-03 10:01:08 EDT
I've eliminated some things as being triggers:

File location.
The preferences dialog itself.
Just typing stuff in a new file.

Currently looking at two other possible causes:

Opening the Properties dialog before the Preferences.
Just random/unpredictable (Only happened twice so far today).
Comment 14 Robert Chapin 2019-04-03 10:23:22 EDT
Good news.  With some persistent testing I've found one way to reproduce one particular bug.  Any changes made to the autosave interval while a file is in an unsaved state will fail to take effect until after the file is saved again.

1. Confirm the autosave interval is some default value like 15 minutes.
2. Confirm the file is in a saved state.
3. Add a transaction so that the file is now in an unsaved state.
4. Change the autosave interval to 1 minute.
5. Add another transaction.
6. Wait 2 minutes.

Every time I follow those particular steps, the new autosave interval fails to work as expected.

I don't think this is the only bug involved here, but it's a good place to start.
Comment 15 Wm 2019-04-04 09:10:11 EDT
It sounds to me some normalisation of the autosave options my be required.

I have never specifically tested it but if saving kicks in when a person is part way through a transaction you can end up with gnc creating an out of balance file (supposedly impossible but i have observed this)

I have suggested this is linked to other items on the buglist.

let's see what happens in triage

===

for the record I think 1 and 2 minute saves might be the problem depending on if you're saving on a local hard disk or across some gigantic cloud network.  hint: gnc does better locally and is relying on other stuff it can't and shouldn't need to understand for the actual transport across the globe, in essence gnc is not distributed, some of the backends are capable of being distributed dbs, gnc isn't, it keeps everything in locaal memory and writes the db not transactions
Comment 16 Robert Chapin 2019-07-11 08:18:41 EDT
Bug confirmed in v3.6, as described in Comment 14 above.
Comment 17 Wm 2019-07-13 10:32:34 EDT
I suppose the silly question might be how often do you change your preferences and why?  I could understand once a day but if you're autosaving at, say, 15 minute intervals, how do the two things conflict?
Comment 18 Robert Chapin 2019-07-13 14:07:31 EDT
I don't understand your question.  If I need my data entry saved every 2 minutes and I change the preference to 2 minutes from 15, it fails.  In that situation, the preference is useless until I manually restart GnuCash or whatever it is that causes the damn thing to start working.
Comment 19 Wm 2019-07-14 02:09:51 EDT Comment hidden (offtopic)

Note You need to log in before you can comment on or make changes to this bug.