Skip to content

Last opened database is not saved except on program close (while database is opened) #7947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nightfirecat opened this issue Apr 25, 2022 · 4 comments

Comments

@Nightfirecat
Copy link

Overview

I've recently changed the directory of my database file, let's say from /a/db.kdbx to /b/db.kdbx, then opened it with KeePassXC. All was fine and well, but when shutting down or rebooting my PC and reopening KeePassXC, rather than reopening the file (now located at /b/db.kdbx), it opened the start screen with the recent files list at the bottom. ~/.cache/keepassxc/keepassxc.ini showed that LastOpenedDatabases=/a/db.kdbx despite having opened the file most recently from /b/db.kdbx. This only resolved itself once I unlocked the database, then closed the program with it unlocked and re-launched during that same session.

Steps to Reproduce

  1. Open a database in any directory, close KeePassXC
  2. Move the database, relaunch KeePassXC, and open the database from its new location
  3. Note that LastOpenedDatabases is not updated. It is further not updated when closed during shutdown and reboot

Expected Behavior

I would expect this changed location to be written after a database is opened, or during login session shutdown/restart.

Actual Behavior

It is only changed on program shutdown.

Context

Unlike #5313, ~/.cache is not mounted to a temporary fs. My setup does not involve any fs being mounted/unmounted during day-to-day use.

KeePassXC - Version 2.6.2
Revision: e9b9582

Operating System: Debian 11
Desktop Env: KDE
Windowing System: X11

@droidmonkey
Copy link
Member

droidmonkey commented Apr 25, 2022

We only save the open databases at program close. So what you describe is expected behavior.

@Nightfirecat
Copy link
Author

I would expect that closing the program via the UI should behave the same as SIGTERM, which is how it is closed on shutdown. Is there a reason they are not handled the same way?

@droidmonkey
Copy link
Member

droidmonkey commented Apr 25, 2022

I don't know what you mean by that. We don't have diverging methods of closure.

@Nightfirecat
Copy link
Author

I guess my confusion is that I wouldn't consider Database -> Quit via the menu / keyboard shortcut to be the only "valid" way to close the program such that open databases would be saved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants