Kunzisoft / KeePassDX

Lightweight vault and password manager for Android, KeePassDX allows editing encrypted data in a single file in KeePass format and fill in the forms in a secure way.
https://www.keepassdx.com/
GNU General Public License v3.0
4.71k stars 276 forks source link

Dopbox sync : Database gets overwritten by empty file #1594

Closed HifeFish closed 5 months ago

HifeFish commented 1 year ago

Describe the bug

Every now and then, KeepassDX overwrites the database with an empty file.

To Reproduce

Steps to reproduce the behavior: I am not sure what triggers the problem. Possibly related to being flushed from memory in the background while trying to generate or save login data entered in Firefox.

Expected behavior

Never overwrite the database with an empty file. Possibly one could write a new file before deleting the old one in case a crash occurs while writing the database.

KeePass Database

KeePassDX:

Android:

Additional context

-

J-Jamet commented 1 year ago

The problem comes from Dropbox, which doesn't manage file caches properly. https://github.com/Kunzisoft/KeePassDX/wiki/File-Manager-and-Sync#file-manager-application

Have you contacted the Dropbox team and what did they say about this?

J-Jamet commented 1 year ago

There's already a cache that prevents the file stream from being written if an exception is raised. Obviously, this can only work if the Dropbox application manages its errors and raises exceptions.

J-Jamet commented 6 months ago

Behavior has been improved with the cache, linked to #1680