Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropbox does not provide the correct content after a conflicting file save #1181

Closed
Alienmaster opened this issue Dec 20, 2021 · 6 comments
Closed

Comments

@Alienmaster
Copy link

Describe the bug
I had a saving conflict with dropbox and two devices. I removed the conflict duplicate database and removed it also in the KPDX App. The KPDX App doesn't load the database new. This is an issue in KPDX bc i restarted KeePassXC on my PC and it loaded the right version from Dropbox. I loaded the Database into Keeweb and it loaded the right version of database. I loaded the database on the same phone into KeePass2Android and it loaded the right version. I removed KPDX and every saved info and after that it loaded the old and wrong version

To Reproduce
Steps to reproduce the behavior:
Store the Database on eg Dropbox

  1. Change a Value and save the database in KeePassDX
  2. Change another Value and save the database on another device with KeePassXC and generate a conflict
  3. Close all KeePass Versions and open the database again. The KPDX App doesn't update anymore (even if you click it in the app)

Expected behavior
Load a fresh copy of the database and not a cached one

KeePass Database

  • Created with: KeePass 2.x
  • Version: 2
  • Location: Dropbox
  • Size: 110Kb

KeePassDX

  • Version: 3.0.4
  • Build: free
  • Language: german

Android

  • Device: OnePlus 8T
  • Version: 11
@J-Jamet
Copy link
Member

J-Jamet commented Dec 21, 2021

KeePassDX only loads the data that the file manager sends it (here Dropbox). There is no database cache file in KeePassDX.

This is an issue in KPDX bc i restarted KeePassXC on my PC and it loaded the right version from Dropbox. I loaded the Database into Keeweb and it loaded the right version of database. I loaded the database on the same phone into KeePass2Android and it loaded the right version. I removed KPDX and every saved info and after that it loaded the old and wrong version

Your analysis is wrong, the problem comes from the Dropbox application which does not manage file conflicts to provide the content you wanted. KeePassDX would have asked you anyway what to do (reload or overwrite) if the content is different because the data in the file provided by the URI has changed.
On PC you use the Dropbox synchronizer, so it's normal that it works. In KeePass2Android, you are probably using the Dropbox API and not the Dropbox file manager SAF so it's not the same method.

If you don't want the cache file in the Dropbox app, ask the developer of this app to have a different behavior.

https://github.com/Kunzisoft/KeePassDX/wiki/File-Manager-and-Sync#explanation
Linked to #840

@J-Jamet J-Jamet closed this as completed Dec 21, 2021
@J-Jamet J-Jamet changed the title Database doesn't update anymore after conflict Dropbox does not provide the correct content after a conflicting file save Dec 21, 2021
@Alienmaster
Copy link
Author

I opend the Dropbox App and choose "open with" and choosed Keepass2Android: right database version.
I did the same with KPDX: wrong database version. So the way to open the database were both identical

@J-Jamet
Copy link
Member

J-Jamet commented Dec 21, 2021

KeePassDX cannot invent data and the data is only stored in the stream of the open URI.
What is the URI of the database you are opening? (In KeePassDX, you can see it in the history of open databases, it is "content://...")

@J-Jamet
Copy link
Member

J-Jamet commented Dec 21, 2021

It is possible that Dropbox keeps a different cache at each URI offered to client applications, I don't know how this application works.

@Alienmaster
Copy link
Author

i removed the wrong database in KPDX from yesterday and added it with "open with" new to KPDX and the URI changed from an incredible long one to a very short "content://com.dropbox.android.FileCache/filecache/aaabbbxxx ...".

When i add the file through the KPDX dialog i get the URI "content://com.dropbox.product.android.dbapp.document_provider.documents/document/(6 lines of letters).
KPDX recognises its the same database and shows me the biometric dialog.

@J-Jamet
Copy link
Member

J-Jamet commented Dec 21, 2021

KeePassDX cannot recognize the same database with different URI. If it offers you biometric unlocking, it is because you have filled it in for that specific URI at some point.
In the first URI, we see that it tries to access a cache. More tests should be done with Dropbox, but I don't want to spend time on it (I have already lost too many and no correct answer from their support), but the wiki should be updated to transcribe the behavior of this app.
I'll look into it when I'm forced to integrate their API into a separate application to bypass the weird behavior. #840 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants