android icon indicating copy to clipboard operation
android copied to clipboard

[BUG] Unsynchronized files already downloaded via Android document provider

Open axoze opened this issue 3 years ago • 11 comments

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

  1. Download a file within the ownCloud Android App
  2. Modify the file within other clients
  3. Open an editor and open the file using the DocumentsProvider
  4. Downloaded version is opened (but not the latest one)
  5. After saving it, a new conflict notification appears

axoze avatar Oct 04 '21 11:10 axoze

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.

michaelstingl avatar Oct 04 '21 11:10 michaelstingl

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)

axoze avatar Oct 04 '21 14:10 axoze

Could you post the exact steps you performed? Maybe add some screenshots too…

michaelstingl avatar Oct 04 '21 15:10 michaelstingl

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.

abelgardep avatar Oct 05 '21 07:10 abelgardep

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?)

axoze avatar Oct 05 '21 09:10 axoze

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.

abelgardep avatar Oct 05 '21 10:10 abelgardep

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!

axoze avatar Oct 05 '21 21:10 axoze

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

christian-dienste avatar Feb 24 '22 12:02 christian-dienste

Check ETAG before opening? What's the effort?

michaelstingl avatar Apr 13 '23 12:04 michaelstingl

May I ask what the status of my bug report is? Or is there a workaround?

axoze avatar Aug 19 '23 21:08 axoze

@axoze no fix for the moment, but it's in our minds (together with many others). Thanks for the patience.

jesmrec avatar Aug 21 '23 06:08 jesmrec