android
android copied to clipboard
[BUG] Unsynchronized files already downloaded via Android document provider
When I select a file in my OwnCloud folder via the standard Android file dialog in an Android app (not the OwnCloud app), often the selected file is not synchronized/up-to-date.
I can fix the problem by opening the OwnCloud app and downloading the desired file. After that, I get the synchronized file by using the standard Android file dialog in other Android apps.
Steps to reproduce
- Download a file within the ownCloud Android App
- Modify the file within other clients
- Open an editor and open the file using the DocumentsProvider
- Downloaded version is opened (but not the latest one)
- After saving it, a new conflict notification appears
Please access files with Document Provider Integration: https://doc.owncloud.com/android/latest/document_provider.html
Direct access to device filesystem is deprecated and won't be possible with the next version.
Sorry for having been unclear, but the app uses Document Provider integration:
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT).setType("*/*");
(if needed, I can post more code)
Could you post the exact steps you performed? Maybe add some screenshots too…
Hi @axoze, thanks for reporting this. You are totally right.
When using the documents provider we only download the version from the server if the file is not downloaded yet. In case it is already downloaded, we do not check if the version is outdated. That's why you got this error.
It could be fixed by adding a new call to check if we have the latest version. It could increase the time to open the file but we will assure that we are working with the most updated version.
Do I have to wait for a fix in the OwnCloud app or is it possible to adopt a third-party Android app suitably? (For example: Can I tell the documents provider to not use any "cached" versions of a file?)
No, it is not possible at all. This is related to the ownCloud App. This happens when you previously downloaded the file.
As a temporary solution, you can sync the file within the ownCloudApp and then open it via documents provider. Or you can remove the file locally, and then open it, so the latest version will be downloaded.
Well that's really a strange behavior of the OwnCloud app: the file dialog shows the correct date and time of the most up-to-date version of the file, but I get an older version of the file. To me, that's not what I'm expecting if I want to synchronize files ...
Please add at least an option "always download files when opening" to the OwnCloud app.
Thank you!
Please access files with Document Provider Integration: https://doc.owncloud.com/android/latest/document_provider.html
Direct access to device filesystem is deprecated and won't be possible with the next version.
THANKS, it works that way I also use files from marc apps & software (no permissions) to have one click access to own cloud files
christian
Check ETAG before opening? What's the effort?
May I ask what the status of my bug report is? Or is there a workaround?
@axoze no fix for the moment, but it's in our minds (together with many others). Thanks for the patience.