nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.18k stars 1.75k forks source link

strange behavior on Updating a file #416

Open Ventusfahrer opened 7 years ago

Ventusfahrer commented 7 years ago

Actual behaviour

I opened a file stored on the server (not marked to be offline available in the Details... of the APP). It was a OpenOffice Spreadsheet. The file get's downloaded and is opened with AndrOpenOffice.

After changing and saving the spreadsheet. The file does not get uploaded by nextcloud-APP. There was no information in the Upload-activity-log.

After that I checked the box offline available. In the same moment the file get's uploaded to the server.

Expected behaviour

depends on the design spec: I assume that a file not to be stored locally (offline available = false) is copied to the tmp folder and opened from there. If this file is updated and the server file is to be updated by specification I expect the file to be immediately updated on the server (or at least within seconds). If an update of the file in the tmp folder will not be updated on the server by design then I would not expect the file to be uploaded after marking the file offline available

Steps to reproduce

  1. Create a spreadsheet file with openoffice on the PC and wait until it is uploaded to the server
  2. open the file by tipping it in nextcloudAPP
  3. change it and save it
  4. wait some minutes to check whether the file is going to be uploaded (in my case it is not uploaded)
  5. now long-tip on the file in nextCloudApp, select ... Menu - Details, check the offline available checkbox - the modified file immediately get's uploaded to the server

Environment data

Android version: 6.0.1

Device model: Google Nexus 5

Stock or customized system: stock

Nextcloud app version: 20161129-beta

Nextcloud server version: 10.0.1

regards

Peter

AndyScherzinger commented 7 years ago

Calling @nextcloud/android, @jancborchardt, @eppfel to the rescue :) The actual behaviour described by @Ventusfahrer is how the app works at the moment and to some extend another, related scenario has been reported by @jancborchardt in #414. So we should or rather have to generally discuss how the client should handle files regarding up/downloads.

Right now we do have the following behavior implemented:

  1. opening a file (from the server) triggers a download and opening of the file while the file is stored within the client's folder structure (not a temp directory).
  2. a "downloaded" file is not kept in sync with the server in any way, neither re-downloaded when the file changes on the server, nor uploaded when it is changed on the client. It is simply "downloaded"
  3. marking a file "keep available offline" will trigger a download (basically what 1. does)
  4. a "keep available offline" file will be kept in sync. Afaik if changed locally (and the app detects that) it will be uploaded to the server, if changed on the server it will be re-downloaded when opened (so there is no real keeping in sync imho)

So this is how it is right now, looking forward to the discussion and the result on how it should be :)

Ventusfahrer commented 7 years ago

well, it looks a little different on my device:

f1 created on the server - tipped on the mobile device, changed and saved on mobile. f2 created on the server - tipped on the mobile device, changed and saved on mobile - marked as available offline --> get's uploaded to the server f3 created on the server - tipped on the mobile device, changed and saved on mobile: very interesting: it get's uploaded to the server without being market offline available. this obviously happened with all files created downloaded and modified in this directory after f2 marked as available offline!

if you modify f1 and save in on the mobile - it will not get uploaded - never again.

if you modify f3 on the server - it will never be synced automatically to the mobile

this behavior is very strange!

Ventusfahrer commented 7 years ago

in addtion to the last test (if you modify f3 on the server - it will never be synced automatically to the mobile):

if you delete the file on the servier it is immediately also deleted on the client, which means in other words: no update on the mobile when the file is changed on the server, but it is deleted when the file is deleted on the server - this is an inconsistent behavior!

Ventusfahrer commented 7 years ago

the behavior that all files are automatically uploading their changes from mobil to the server without being marked as offline available stopped after rebooting the smartphone and starts again after the first file is marked for offline available in a directory.