keepassxreboot / keepassxc

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

Incorrect behavior on close #10632

Closed LLKoder closed 4 months ago

LLKoder commented 4 months ago

Overview

I opened base (only one base). Base has kept opened a some time. I didn't edit base and I not add password. But some time ago the database is edited itself and the database had the status of unsaved. May be it can't save itself for some reasons. I do not see notification, so I work in other window and 10149 do not solve for now.

Now the application does not allow me to close without saving. Any attempts to close the base without saving fail.

Now I have unclosed base. I have to close app via kill process so I don't know what app action was going to unsave status and don't understand what changes in it.

Issues:

  1. Why app add something to base and make it unsaved?
  2. Why app doesn't allow me to close itself?
  3. Why app doesn't have dialog with question "Save", "Don't save", "Cancel"?

My base is located on NAS server, may be it particaly open solve. In settings I use "Automatically save after every change" either.

I think app have to work with this case correct, may be it can't save, but where are dialog? Where are buttons? What actions is app doing?

2024-04-28_10-05

Steps to Reproduce

See above.

Expected Behavior

  1. App do not have any actions with base itself.
  2. App have dialog with buttons "Save", "Don't save", "Cancel".
  3. Correct behavior.

Actual Behavior

Nothing to do. Incorrect behavior.

Context

KeePassXC - Version 2.7.7 Revision: 68e2dd8

Operating System: Linux Desktop Env: Gnome/KDE/XFCE/Mate/Cinnamon Windowing System: X11/Wayland

droidmonkey commented 4 months ago

This doesn't make any sense. Are you saying the app froze when you tried to lock the database or close the app? Do you have "save after every change" enabled? If you lost access to your NAS, then it would make sense that save would have failed.

We definitely do ask you if you want to save on close.

LLKoder commented 4 months ago

App not freeze I can continue close app after saving. I can do any actions (add, edit, remove etc...) either. I can't close app without saving only.

Yes as I said I have "save after every change" enabled.

My connection with NAS is ok. I have worked all the time at PC and with NAS.

But the app doesn't ask me "Save", "Don't save", "Cancel" in this case.

LLKoder commented 4 months ago

BTW in my base there are some KeyShare folders but they didn't edit at that time. Maybe this problem has something to do with #10633.

LLKoder commented 4 months ago

I noticed file in backup folder qt_temp.ZpxIiA with zero size on NAS. I don't understand in setting I use: 2024-04-28_11-51

droidmonkey commented 4 months ago

Unfortunately, I have absolutely no idea what you are trying to say. If you have save after every change enabled then we will obviously not ask you if you want to save.

LLKoder commented 4 months ago

ok, but:

  1. Is it normal for the application itself to change the database? I do not perform any actions (adding, editing, deleting, etc.) and I see that the database is in the unsaved status after some time. I just opened base to get a some passwords.
  2. What is the qt_temp.ZpxIiA file in the zero-size backup folder? IMHO the application tries to save the database and cannot.
droidmonkey commented 4 months ago

Changes can happen for many reasons, when you collapse and expand groups for example. There is a small bug in 2.7.7 with keeshare that causes the database to be modified on unlock for specific circumstances. That was fixed for 2.7.8.

We don't write a file with the name of qt_temp.xxxxx, that is not from us.

LLKoder commented 4 months ago

Changes can happen for many reasons, when you collapse and expand groups for example. There is a small bug in 2.7.7 with keeshare that causes the database to be modified on unlock for specific circumstances. That was fixed for 2.7.8.

Thanks. Now I have a better idea of ​​how the application works.

We don't write a file with the name of qt_temp.xxxxx, that is not from us.

But the file was located in backup folder. This directory was used for KeePassXC backup files only. If application does not write a file, it is possible that libraries used by the application are writing the file. For ex. QT.

Screenshot from 2024-04-28 12-43-37

I open my base remotely from NAS. Backup and share on NAS either.

droidmonkey commented 4 months ago

Are you seeing backup files at all? If not then you have a permission issue.

LLKoder commented 4 months ago

Yes, I can see. And I can read/write files from this directory, I can read/write any files and directories. Other app can read/write either without limit. So my permissions is ok.

if I click "Save As" and save base to NAS with other name - all ok.

I noiced if I click "Save" or add entry the app like be frozen and don't close. Backgroud is grey. But tab menu is active. If I click "Save" I get: Screenshot from 2024-04-29 11-09-46 I noiced it only now.

And I noiced if I relocate my base to local PC from NAS qt_temp.xxxxx not appear and this issue is gone.

I seems like qt_temp.xxxxx appear when the app want to do action in certain moments. And it seems will the app must to rename qt_temp.xxxxx to name of base itself in future if the app will able correctly write data.

In result I can do "Save As" but I canot do "Save" on NAS (Samba).