OpenArchive / Save-app-ios

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

App Crashes in Background #191

Closed johnhess closed 2 years ago

johnhess commented 2 years ago

Running the latest test flight (2.7.1), I'm getting lots of background crashes. Usually I get the notification when I unlock the phone to look at an unrelated notification. I get 5-10 a day.

I have IA, Dropbox and a NextCloud backend installed.

I have not looked at the crash reports yet (no access).

tladesignz commented 2 years ago

Oh, man. So, I worked on this for days. Apple really curbed it down for good. There is just no way to upload anything in the background. The only thing you can do is actually the raw up- and download of files. But that's just not enough. We need to create folders, too. But all requests, which aren't sending a file or receiving one are stopped immediately and you either receive a crash or are halted indefinitely, depending on the way you try. The only thing which is possible with this is continuing an upload of a bigger file when the user sends the app into background. I'm going to remove all the code which tries to grab some background processing time to get rid of the crashes. If a user wants to upload a bunch of files, the only way to achieve this is to keep the app open.

I'll add a keep-the-lights-on thingy to the current-uploads-list scene. That way, at least the device doesn't go to sleep.

tladesignz commented 2 years ago

I added commands to keep the screen on, and also to honour proximity monitoring (which turns off your screen when you're close to e.g. your face), while in the upload management scene.

This way, if people want to make sure their uploads get finished, they can go to that scene and put their phone on the table face-down and they won't burn energy for a screen they're not looking at.

Now we would just need a way to explain that to the user.

Happy to receive suggestions on where to put that info (e.g. on top of the management scene? As a show-once info box?) and the text to use.

Changes will be contained in next TestFlight (v2.7.1 build 59)

johnhess commented 2 years ago

This way, if people want to make sure their uploads get finished, they can go to that scene and put their phone on the table face-down and they won't burn energy for a screen they're not looking at.

that's clever!

Now we would just need a way to explain that to the user.

i guess we'll have to be clever about that, too. I'll create a UX ticket linked to this conversation.

purvi-ranawat commented 2 years ago

@johnhess @tladesignz Currently the app is not crashing, I had been trying since last 2 days, but will keep an eye on it.