For some records it is not possible to see and save attached files. But in some records everything works fine.
Affected version: KeePassDX Pro 2.8.5
In KeePassDX 2.8.1 all works
OnePlus 7 Pro, Android 10
Can you be more specific about the conditions that prevent seeing certain attachments or a database that reproduces the problem? Because I have already identified where it comes from before I can correct it.
I don't even know how to describe it.
Here is the group tree:
file.kdbx:
KeePass 2 - KDBX4.0, ChaCha20, Argon2, Gzip
I also want to note that when viewing the history of item changes, files are also not visible
P.S.
The error is repeated also open the database in any mode: for reading or for changing.
I have just uploaded a new file to Item 2.1 on my computer and deleted the old file in Item 2.1. I downloaded the database to my phone - there is still an error.
Strangely, attachments fields don't show the same result every unlocking.
Keepass Database
KeePassXC demo database
Password: secret
Its entry "My Computer/SSH key" have two attachment id_rsa and id_rsa_pub, but id_rsa_pub occasionally disappears in KeePassDX v 2.8.5
My database created by KeePassXC also reproduce this issue, and KeePassDX rarely displays attachments fields correctly.
Android:
Sorry, I have tried on several of my emulators and I cannot reproduce the problem.
I see the attachment well every time with the database you submitted.
Are you doing a specific action? Or a series of specific actions?
~I found the problem. I managed to reproduce a database that prevents visibility of some attachments (by adding and removing attachments with the same name). This comes from the pull request -> #673 . When the commit is reverted, everything is OK.~
demo.zip
Password: secret
Sorry I did my tests, and it worked when I reverted the commit. But it's maybe a coincidence, it's very surprising because there is no specific cause for this bug, it seems to happen randomly.
I compiled the development branch and can still reproduce this issue.
I submit another database with two attachments SSH key id_rsa(1.15kB) and id_rsa_pub(350B).
KeePass occasionally shows rsa_id's size as 350kB and save id_rsa_pub in the storage if you try to download id_rsa.
Keepass Database
keepass.kdbx.zip
pThanks for the new base, I can reproduce the anomaly quite often. I have done a lot of checks but still don't know the cause.
OK, I think I found the solution. It seems that using current time in millisecond is not a good way to have unique items for fast cpu's. Because some elements will have the same timestamp. So I will modify the binaries ids by an incrementer.
It should be OK with the develeop branch
Guys, I think you also need to test saving/upload files to records using KeePassDX (Pro). Otherwise, important data may be lost.
@Drive4ik What to you mean exactly?
@J-Jamet I mean, if you open the base for writing with KeePassDX, load a new file as attached and save the base. And then check, for example, using KeePass Password Safe in Windows (I use it). I say this so that the fix of this problem does not affect for upload attached files.
This is what I usually do. I don't release without testing a minimum but I can miss errors because I have my nose in the code and I do this in my spare time.
Here, the issue was rather difficult to detect because the problem does not occur in debug. The timestamp is well spaced between each element. It was only possible to see the problem when the code was optimized during its execution.
This is why github feedback is important and why I always put in beta (Play Store) before putting in stable. Users can test on a large scale.
This issue is resolved but I noticed that the attachments are not well recognized on KeePass2 (0B) but well recognized on KeePassXC, if anyone has any idea of the cause? (New issue https://github.com/Kunzisoft/KeePassDX/issues/715)