owncloud / android

:phone: The ownCloud Android App
GNU General Public License v2.0
3.77k stars 3.08k forks source link

Improve av. offline performance #4354

Closed Aitorbp closed 2 months ago

Aitorbp commented 3 months ago

Related Issues

App: https://github.com/owncloud/android/issues/4197


QA

Checks:

Reports:

jesmrec commented 2 months ago

QA checks:

Feature:

Regressive sync use cases

jesmrec commented 2 months ago

(1) [FIXED]

Check the following steps out. We are losing the sync condition in the basic av. offline case.

  1. Create a folder and add some files inside (better images)
  2. Set the folder as av. offline (without browsing inside)
  3. Wait till everything download
  4. Unset the folder as available offline
  5. Remove locally the content of the folder
  6. Repeat step 2.
  7. After some seconds, remove device connection
  8. Browse into the folder and click on any file

Current: not posible to preview

Expected: file displayed. It is available offline, so the preview must be always available. When the folder was set as av. offline in step 2. all content inside had to be synced. It doesn't

Pixel 2 Android 11 d86367b9c

Aitorbp commented 2 months ago

(1)

Check the following steps out. We are losing the sync condition in the basic av. offline case.

  1. Create a folder and add some files inside (better images)
  2. Set the folder as av. offline (without browsing inside)
  3. Wait till everything download
  4. Unset the folder as available offline
  5. Remove locally the content of the folder
  6. Repeat step 2.
  7. After some seconds, remove device connection
  8. Browse into the folder and click on any file

Current: not posible to preview

Expected: file displayed. It is available offline, so the preview must be always available. When the folder was set as av. offline in step 2. all content inside had to be synced. It doesn't

Pixel 2 Android 11 d86367b9c

With the change of refresh functionality, from now on only files that have been modified will be returned. This means that the local etag and the server etag are different. With this known, we are presented with the case discovered by @jesmrec.

This means if we delete the local copy and we want to make a set available offline, it will compare between two equal etags, as the file on the server has not changed and the local etag has remained as it was before deleting it.

So the condition has not detected that there was a change if we make the files available offline after deleting the content of the folder locally. This means that the download is not done even if it is available offline. If we take the connection offline and enter a file it will not be available.

So to solve this we must set the etag parameter to null if we want to delete files locally. This way, they will be downloaded again.

jesmrec commented 2 months ago

(2) [FIXED]

may be related with (1)

  1. Set a folder as av. offline
  2. Using other client, web f. ex., add more files to the folder
  3. In app, pull to refresh (not browsing inside)
  4. Remove device connection
  5. Try to open the file added in 2.

Current: file not opened

Expected: file should be opened. Pull to refresh action should trigger a sync in the av. offline folder because the etag changed after new item was added inside.

Pixel 2 Android 11 b1cad6fb

jesmrec commented 2 months ago

(3) [FIXED]

  1. Set a folder as av. offline
  2. Modify any file inside the folder using the open with option (i used a txt file with the quickedit free editor)
  3. Save modifications in external editor
  4. Go again to the app

Current: changes are not synced back to the server. Even pulling to refresh, changes not pushed

Expected: just entering the to the containing folder, changes are synced back to the server (checked current master)

Pixel 2 Android 11 d75ebeae0

jesmrec commented 2 months ago

Go ahead with this! approved.