After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 451889 - Implement auto-save feature
Implement auto-save feature
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: User Interface General
git-master
Other All
: Normal enhancement
: ---
Assigned To: Christian Stimming
Chris Shoemaker
: 107365 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-06-28 14:10 UTC by Christian Stimming
Modified: 2018-06-29 21:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initial proposal for implementing auto-save (1.93 KB, patch)
2007-06-28 14:12 UTC, Christian Stimming
none Details | Review
2nd try for auto-save (6.21 KB, patch)
2007-06-29 08:37 UTC, Christian Stimming
none Details | Review
Even more complete implementation (6.86 KB, patch)
2007-06-29 10:27 UTC, Christian Stimming
none Details | Review
And add yet more special-case handling (7.10 KB, patch)
2007-06-29 13:39 UTC, Christian Stimming
none Details | Review
This actually works (14.31 KB, patch)
2007-06-29 17:14 UTC, Christian Stimming
none Details | Review
This works indeed (14.34 KB, patch)
2007-06-29 19:23 UTC, Christian Stimming
none Details | Review
Now we have everything. (15.53 KB, patch)
2007-06-30 10:15 UTC, Christian Stimming
none Details | Review

Description Christian Stimming 2007-06-28 14:10:47 UTC
We've been asked every other month to offer "auto-save" for the file backend. Eventually after reading "The Design of Everyday Things" it occurred to me we simply have to offer something like that - people expect it, so it whould be there. Also, technically it isn't at all hard to do it. So there we go.
Comment 1 Christian Stimming 2007-06-28 14:12:24 UTC
Created attachment 90803 [details] [review]
Initial proposal for implementing auto-save

That's how this could be working. So far the gconf key lookup for the time interval is still missing (which should offer one-minute granularity, where Zero means autosave is switched off). But the principle is already there. (Untested, though.)
Comment 2 Andreas Köhler 2007-06-28 19:59:53 UTC
Just want to add that this is not suitable for 2.2.x, because it may destabilize the system and greatly changes user experience.
Keep it up, Christian :-)
Comment 3 Christian Stimming 2007-06-29 07:03:09 UTC
"destabilize" the system, häh? Whatever. I agree this cannot be included in 2.2.0 unless there has been considerable testing, which is not available in the current schedule. For some later 2.2.x, however, I don't see what would speak against it.
Comment 4 Christian Stimming 2007-06-29 08:37:09 UTC
Created attachment 90848 [details] [review]
2nd try for auto-save

This is basically the full auto-save feature. Only the preference for the time interval needs to be added.

Actually this feature could alternatively still be added for 2.2.0 and used for prominent marketing of the new release. "More user-friendly than ever" etc.
Comment 5 Christian Stimming 2007-06-29 10:27:21 UTC
Created attachment 90853 [details] [review]
Even more complete implementation

Now this code is pretty much completed. The preferences are handled correctly, and book closing is handled, too. I'd even go as far as considering this indeed for 2.2.0.
Comment 6 Andreas Köhler 2007-06-29 11:07:46 UTC
WRT comment 2: s/the system/gnucash/

Well, I have not taken a look at your patch yet.  If you think it is great, then maybe it is :-D

But I did not read any recent discussion of this type of request and this implementation, so my instinctive feeling tells me that this change would be too late in the 2.2 release cycle.

Maybe I missing the scope of this patch.  Is this really a trivial issue?
Say, an import process is taking a few minutes, spawning a main loop to update a progress bar.  Can that loop call gnc_file_save()?

Just call me pessimistic :-)
Comment 7 Christian Stimming 2007-06-29 12:03:58 UTC
*** Bug 107365 has been marked as a duplicate of this bug. ***
Comment 8 Christian Stimming 2007-06-29 13:39:45 UTC
Created attachment 90869 [details] [review]
And add yet more special-case handling

Added checking gnc_file_save_in_progress() before initiating our own filesave.
Comment 9 Paolo Benvenuto 2007-06-29 16:18:45 UTC
Consider that some operations could take a very long time on slow systems.

- Saving the data file last at least 10 seconds, but could be more than one minute if my computer were worst. Autosave shouldn't interfere with normal save.

- Generating a report could be a very long (about 5 minutes) operation. We have to see what gnucash is going to do if autosave trigger during a report generation.

Autosave must be a feature that doesn't interfere with normal work: my 10 seconds saving should be done enterely in the background, so that it doesn't prevent me entering the txn.
Comment 10 Christian Stimming 2007-06-29 16:37:08 UTC
(In reply to comment #9)
> Autosave must be a feature that doesn't interfere with normal work:

With all due respect, but no, it must not "be a feature that does xyz". 

The point is: currently we don't have any auto-save at all. What kind of auto-save feature is an improvement from hereon? Something "entirely in the background" is almost impossible to do with the current engine structure, because the current XML backend requires the book to be unchanged *during* saving. Which, of course, is a contradiction to "saving happening in the background". 

Would the auto-save that we currently have here already be an improvement for a majority of users? If yes, then we offer it. If no, well, then we won't have any auto-save for many more versions and years to come.
Comment 11 Christian Stimming 2007-06-29 17:14:09 UTC
Created attachment 90886 [details] [review]
This actually works

This patch has been tested. Albeit only on a small file, but it works surprisingly well. I'd indeed go as far as suggest it for 2.1.5. Please test it as well. THanks.
Comment 12 Andreas Köhler 2007-06-29 17:27:04 UTC
What about KEY_AUTOSAVE_SHOWED_EXPLANATION so that FALSE can be the default?

I will give it a try.  We really need a mail to gnucash-{devel,user} so that others participate with testing though.
Comment 13 Christian Stimming 2007-06-29 18:36:01 UTC
(In reply to comment #12)
> What about KEY_AUTOSAVE_SHOWED_EXPLANATION so that FALSE can be the default?

What's the implications of having FALSE the default? I wanted a key that is FALSE during normal operation, and TRUE only at the beginning but it will be set to FALSE after the first run. That's why FALSE as the value for the normal operation seemed more suitable to me, with TRUE being the default as specified in the schemas file.
Comment 14 Andreas Köhler 2007-06-29 18:46:04 UTC
Well, I think we decided to try to have FALSE as default, so that missing / unset keys will match default behavior.  Oh, and with default I mean "user starts GnuCash for the first time", not "normal operation" here.

That is why we chose dev/allow_file_incompatibility.
But hey, I added general/show_splash_screen...

BTW, there is no "Ok" button :-)
Comment 15 Christian Stimming 2007-06-29 19:23:15 UTC
Created attachment 90895 [details] [review]
This works indeed

With yet another sanity check I tested this with my large normal data file, and there don't seem to occur any problems.
Comment 16 Christian Stimming 2007-06-29 20:28:13 UTC
However, during the auto-save the UI isn't turned inactive, and also the progress bar doesn't seem to show the progress of saving. I'm a bit at a loss as to which call would be required in addition to gnc_file_save().
Comment 17 Christian Stimming 2007-06-30 10:15:32 UTC
Created attachment 90922 [details] [review]
Now we have everything.

There we are. It works and correctly switches the UI to inactive. I'd propose to commit to trunk.
Comment 18 Christian Stimming 2007-06-30 11:17:53 UTC
Committed as r16226 (that was attachment#90895 [details]) and r16227 (which contains the changes to attachment#90992 [details]). I'm quite confident this feature is at least ready for beta-testing.

For the record: When the auto-save triggers during a long calculation of a report, the saving is finished first, but the report calculation continues just fine. The only problem here is that the visual feedback of report calculation (the progress bar) is overridden by the saving and not restored; in other words, the user doesn't see that the report calculation is continuing just fine. Once the report calculation finished, the report is displayed just normal.
Comment 19 John Ralls 2018-06-29 21:40:54 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=451889. Please update any external references or bookmarks.