OpenArchive / Save-app-ios

Secure Mobile Media Preservation
https://open-archive.org/
GNU General Public License v3.0
10 stars 3 forks source link

Video exports are killed in the background #165

Closed tladesignz closed 2 years ago

tladesignz commented 4 years ago

Then uploads never finish, because they're never get ready.

Need to show export going on and maybe a timeout with error?

foundscapes commented 4 years ago

definitely timeout with error if this happens, but it hasn't been a big problem these past few weeks

foundscapes commented 3 years ago

This is still a problem - uploads are not completing when app is in background - what can we do?

tladesignz commented 3 years ago

This is still a problem - uploads are not completing when app is in background - what can we do?

Hm. I'm pretty positive I've done everything possible to grab as much background execution time as possible. This is a general problem on iOS which all apps suffer from.

Therefore, the only thing I'm worried about: Does the upload continue when the app comes into foreground again?

johnhess commented 2 years ago

When uploading a large video file (883MB .mov) to NextCloud (sam.nl.tab.digital), the upload stalls at 19.6MB uploaded, even when the app remains in the foreground.

Version: 2.7.1

johnhess commented 2 years ago

Solutions to this could include supporting larger files or notifying users that their file is unsupported before attempting and failing.

tladesignz commented 2 years ago

In the meantime, I threw out 2 libraries which were standing in between this and now use URLSession directly. Please test with next TestFlight v2.7.1, build 59.

Note: If you exit the app, all bets are off. It should (or better might) finish uploading, but that API is so wacky, it's more like a "pretty please, dear iOS".

johnhess commented 2 years ago

@tladesignz what should we expect/test for with these changes? Is background uploading out of our control or are there well defined actions that should work?

tladesignz commented 2 years ago

What to expect:

Regarding our control: Yes, we don't have any control here. We're asking nicely and iOS typically grants us some time, most of the time and might finish a file upload for us.

johnhess commented 2 years ago

Thanks @tladesignz

@purvi-ranawat (and Mike, when you get set up here), could you run the new version through its paces and comment here if you find that it's not behaving as Benjamin's previous comment expects?

purvi-ranawat commented 2 years ago

@johnhess / @tladesignz : After the folder creation and metadata creation, when we kill the IOS app and then reopen app, the error for the particular upload is displayed. I am not able to continue upload for the same file.

Below is the screenshot of the error :

image

johnhess commented 2 years ago

When you see this and hit retry, does that work?

Or, if you hit "cancel", does the app upload the other videos, then retry the failed one? This is what happened for me, and it seems like a sensible retry strategy.

purvi-ranawat commented 2 years ago

@johnhess :

  1. After clicking on Retry, that particular video is uploaded. but after that video, uploading for other videos keeps on processing and not getting uploaded.

  2. After killing the IOS app, when we restart the app, the error for that particular video is displayed but for other videos, it starts uploading but then it keeps on processing and not getting uploaded

johnhess commented 2 years ago

I'm using 2.7.1 (59) and am not able to replicate the persistent failures. If I kill the app, I do get that error indication and the same dialog you see. But, whether or not I select "retry", the app manages to successfully upload all queued videos to NextCloud.

It's possible that part of the problem is https://github.com/OpenArchive/Save-app-ios/issues/196.

@purvi-ranawat Given that this particular issue has morphed a few times and been mostly resolved, can you please create new bug tickets with detailed replication steps and expected/actual outcomes for the remaining failure modes?