keepassxreboot / keepassxc

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

Database file refresh doesn't occur when entry or group is being edited #8545

Open LudekH2 opened 1 year ago

LudekH2 commented 1 year ago

Overview

We are using Windows version KeePassXC 2.7.1. Database is located on network share. When two users are performing edit on the database (different entries) in the same time, changes of the one that save his edit first are lost.

Steps to Reproduce

  1. Two users open database
  2. Both open and edit some entry in the database in the same time.
  3. User 1 saves his changes - he can see them in his KeepassXC after that.
  4. User 2 saves his changes. When he look at the entry edited by user 1 he does not see the recent changes made by user 1.
  5. User 1 close and re-open database. He does not see his recent changes, they are lost.

Expected Behavior

I expect any edits not to disappear from database used in network shared environment.

Actual Behavior

When I do not edit database and other user save his changes to the database I can see the refresh on my side. I suppose his changes are synced with my instance of the application and all is well. However if I have open any entry and I am editing it, in the time he does his save, the refresh apparently does not take place and after I save my changes to the database, his changes are overwritten by my, now outdated version.

Context

KeePassXC - Verze 2.7.1 Revision: 5916a8f

Operating System: Windows 10 + Windows Server 2016 as fileserver Desktop Env: Windowing System:

droidmonkey commented 1 year ago

This is a complicated problem because we don't want to refresh the database while you are actively editing it, however our file manager should have seen that the underlying file changed prior to saving and merge in those changes first. That clearly failed so there is a bug here or the style of network share being used has a cache mechanism that prevents this detection.

LudekH2 commented 1 year ago

I should add, that this is happening with both clients and server on the same LAN. Standard Windows share.

You mention merge - I have experienced multiple times (while connected via VPN) that I was asked to confirm merge. Regardless of my choice (merge or discard) it always ended with application freeze idefinitely.

Thanks Ludek.

droidmonkey commented 1 year ago

I just fixed the above freeze problem.