ios icon indicating copy to clipboard operation
ios copied to clipboard

Autoupload doesn't finish properly

Open MorrisJobke opened this issue 9 years ago • 17 comments

  • latest beta from test flight (2.17 36)
  • having files in the upload queue
  • expected: they are uploaded
  • actual: some are uploaded but then the phone went into "screen locked mode" and since then those entries are not uploaded anymore

Maybe related to #172

cc @marinofaggiana

MorrisJobke avatar Apr 10 '17 02:04 MorrisJobke

Hi @MorrisJobke, I don't understand, the file are in queue but don't start ?

marinofaggiana avatar Apr 10 '17 04:04 marinofaggiana

Yep - I need to disable auto upload and upload the files manually afterwards :/ quite annoying because you first need to check which files are missing

MorrisJobke avatar Apr 10 '17 05:04 MorrisJobke

Background Transfer Considerations

The NSURLSession class supports background transfers while your app is suspended. Background transfers are provided only by sessions created using a background session configuration object (as returned by a call to backgroundSessionConfiguration:).

With background sessions, because the actual transfer is performed by a separate process and because restarting your app’s process is relatively expensive, a few features are unavailable, resulting in the following limitations:

The session must provide a delegate for event delivery. (For uploads and downloads, the delegates behave the same as for in-process transfers.) Only HTTP and HTTPS protocols are supported (no custom protocols). Redirects are always followed. Only upload tasks from a file are supported (uploading from data objects or a stream will fail after the program exits). If the background transfer is initiated while the app is in the background, the configuration object’s discretionary property is treated as being true.

== is the iOS that decide (memory, battery, wi-fi etc) ...

P.S. the NSURLSession is the low level system for comunicate via HTTP, Apple advise against the upload/download of several file in background mode but ONLY one file of big dimension. (see drop...x system).

P.S. Next release I want introduce lock record in DB for view the files that are ready in upload queue, but this required time.

marinofaggiana avatar Apr 10 '17 09:04 marinofaggiana

This was not limited to background only. I could leave the app open after the app was send into background while uploading and then no other files were uploaded even if the app was in the foreground.

MorrisJobke avatar Apr 10 '17 15:04 MorrisJobke

sorry, I don't understand where is the problem ...

marinofaggiana avatar Apr 10 '17 16:04 marinofaggiana

This is what happened:

  • I had 51 files to upload (little badge on the lower left)
  • I opened the app
  • some files were uploaded
  • the phone went into sleep mode (19 files left)
  • I unlocked the phone
  • the Nextcloud app had the "19" badge
  • I opened the Nextcloud app
  • the badge on the lower left showed 19 as well
  • no upload happened - I left the app open and the phone unlocked for 15 minutes in proper wifi - even tried to disconnect and reconnect to the wifi

MorrisJobke avatar Apr 10 '17 16:04 MorrisJobke

0 upload view on Transfer ? but 19 on badge ?

marinofaggiana avatar Apr 10 '17 16:04 marinofaggiana

0 upload view on Transfer ? but 19 on badge ?

Yep - that was the weird thing. I disabled auto upload and the 19 vanished. Then I re-enabled it and manually added the files :/ Then kept the app open until it finished.

MorrisJobke avatar Apr 10 '17 16:04 MorrisJobke

:/ understanding difficult

marinofaggiana avatar Apr 10 '17 16:04 marinofaggiana

:/ understanding difficult

https://github.com/nextcloud/ios/issues/173#issuecomment-292998645 <- this is what happened. What do I need to explain again? Where do you have problems?

MorrisJobke avatar Apr 10 '17 16:04 MorrisJobke

My problem it's know where is the problem 😄

marinofaggiana avatar Apr 10 '17 16:04 marinofaggiana

@MorrisJobke if it happens again, terminates the Nextcloud iOS

https://support.apple.com/en-gb/HT201330

and reopen, this procedure clear the queue in memory and reload the record-upload from DB

marinofaggiana avatar Apr 10 '17 17:04 marinofaggiana

@MorrisJobke if it happens again, terminates the Nextcloud iOS

I will do and report back.

MorrisJobke avatar Apr 10 '17 17:04 MorrisJobke

This also happened to me once using the new beta app but I couldn't reproduce the problem, which makes me wonder how does Owncloud is doing this? because I remember back then when I was using the owncloud app, the app would upload my images after detecting a new entry in the camera roll even if the app was running in the background.

In easier words, you could also upload files automatically if the app was open in the background.

togglecode avatar Apr 11 '17 12:04 togglecode

I have found a possible issue ... we will work

marinofaggiana avatar Apr 11 '17 12:04 marinofaggiana

Little bugfix build 38

marinofaggiana avatar Apr 14 '17 12:04 marinofaggiana

Doesn't happened anymore

MorrisJobke avatar Apr 14 '17 14:04 MorrisJobke