keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
20.01k stars 1.42k forks source link

Allow "save after every change" to be async #10962

Closed agowa closed 1 week ago

agowa commented 1 week ago

Summary

When "Automatically save after each change" is enabled each and every change regardless of how minor or significant will cause the GUI to lock up until the save is complete. It would be great to have the save happen in the background asynchronously and not block the GUI. Especially because keyboard shortcuts (as well as access from the browser or ssh extension) still work even when the GUI is locked aka. grayed out.

Examples

At most the GUI should be restricted to read-only functions while auto-saving.

The auto-save should always be async and unnoticeable to the user as much as possible. Actively clicking the Save button should always be a foreground save and lock the GUI until it completed to ensure the user all changes have been saved successfully. And (queued) auto-saves should be able to merge, aka instead of saving the file 10 times in a row when the first save didn't complete by then should become just one additional save after the first one completed (or in other words a new auto-save should only be queued when there is none queued [in addition to the currently active one] already).

Context

When saving to a remote or network share, to a slow storage device, or even just with high encryption security settings the save operation can take a few seconds and the lockup of the GUI is kinda annoying when it happens after each and every edit. (No disabling the autosave feature is also not desirable, as I know my luck and I'll get dataloss from forgetting to save and having the application crash for some reason [including power outages])

droidmonkey commented 1 week ago

Go to Database -> Database Settings and setup a save delay.

Async saves are just not possible due to the nature of the program and kdbx standard. It would require a complete bottom to top rewrite of the gui and move to transactional changes. Transactional changes are planned, but nowhere near implemented.

agowa commented 1 week ago

Not what I was looking for but good enough for a workaround for now, especially because the minimum value is 1 minute. Thanks for the hint @droidmonkey.

droidmonkey commented 1 week ago

Added some more context above

agowa commented 1 week ago

thanks, I think it may be possible without transactional changes. However I don't know the kdbx standard and it may have something against just diverging in memory the way I imagine it in my head right now.