[TIMOB-19333] iOS: URLSession Module not working properly if system terminates the app during download
GitHub Issue | n/a |
Type | Bug |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Shawn Lan |
Assignee | Unknown |
Created | 2014-11-27T03:12:04.000+0000 |
Updated | 2018-02-28T19:55:17.000+0000 |
Description
If the system terminates the app during a download, after the download finishes (the app remains not running), there are some problems:
1. backgroundtransfer is the last event fired (should be the first)
2. downloadcompleted event handler doesn't get the file blob (evt.data.size==0)
If the system terminates the app during a download, before the download finishes, you launch the app and cancel the download, there is one problem:
1. The partially downloaded file is remained in the storage, not cleaned up. UPDATE: With SDK 4.1.0, it seems the partially downloaded file is cleaned up in this scenario.
These issues didn't exist in previous SDKs, as I've tested it before.
To simulate system terminating the app:
1. download a large enough file
2. during the download, using the Studio to build the app to the device
3. App installed successfully on the device, causing the running instance terminated by the system
4. test the above two scenarios.
Attachments
File | Date | Size |
app.zip | 2014-12-03T02:00:56.000+0000 | 8485566 |
Hi, Please provide a simple test case for this problem, that will be helpful to address the issues. Thanks. Regard, Shuo
okay I attached a simple test app.
The reason for the first issue is that in my app the session is created right away at launch. I do so because I need to update the download progress to the users. If I don't need the session to be created at launch, then I can just create session after "backgroundtransfer" is fired. That way, the first issue is gone. Even so it's still a bug. The "backgroundtransfer" should always be the first to fire no matter what. And like I said, I need the session be created at launch. UPDATE: downloadcompleted event handler doesn't get the file blob (evt.data.size==0) --- this issue seems fixed with SDK 4.1.0 (or with latest iOS version)