keepass2android icon indicating copy to clipboard operation
keepass2android copied to clipboard

[BUG] Saving a kdbx via K2A resets the file's share (Nextcloud).

Open trainedmoose opened this issue 2 months ago • 4 comments

Checks

  • [x] I have read the FAQ section, searched the open issues, and still think this is a new bug.

Describe the bug you encountered:

I share a .kdbx file through my Nextcloud instance (latest update, v31.0.9) to another user of the same instance or via public link. When editing and saving that exact file through K2A (connected via WebDAV or Nextcloud login), all existing shares for this file (both internal and public) will be cleared.

As this doesn't happen when using other operating systems (e.g. Windows, MacOS), I suspect it's an issue with K2A's sync.

Describe what you expected to happen:

The share should still remain after editing and syncing the file with K2A when using Nextcloud sync (using WebDAV or Nextcloud login).

What version of Keepass2Android are you using?

1.14-r1

Which version of Android are you on?

16

trainedmoose avatar Oct 16 '25 19:10 trainedmoose

please try if the behavior persists if you disable Settings > App > File handling > File transactions.

sahriVoraus avatar Oct 19 '25 14:10 sahriVoraus

please try if the behavior persists if you disable Settings > App > File handling > File transactions.

✅ This setting fixes the described behaviour. The file is saved correctly without resetting its shares. Thank you!

I'm just wondering whether this should be a default setting when using those services (WebDAV/Nextcloud). At least a hint/disclaimer/explanation would be nice, I guess.

Should I close this issue?

trainedmoose avatar Oct 19 '25 19:10 trainedmoose

Let's keep it open. I'm not 100% decided how to deal with the various side-effects of the file transactions but will improve this.

PhilippC avatar Oct 20 '25 06:10 PhilippC

I have a similar setup: Main User A shares the .kdbx file with User B, which is used for Keepass2android webdav sync.

With the current behavior, the databases immediately go out of sync, when editing the database on mobile, using User B. This can have ugly consequences, especially as you don't immediately notice. It took me three weeks to realize that I now have two databases. It happened when I was asked for the encryption password of my PC's hard drive, which was nowhere to find in Keepass2android... So there is potential for data loss here.

This is how the file history looks in Nextcloud, for the Keepass2android User B:

Image
  1. The file is created for the transaction.
  2. Then, the original file is deleted (which breaks the sharing)
  3. Then, the transaction file renamed to the original file's name.

After disabling transaction, (and merging, and restoring the share) it works again as expected.

PhilLab avatar Nov 04 '25 07:11 PhilLab