aws-sdk-ios
aws-sdk-ios copied to clipboard
If user force terminated app, suspended AWSS3TransferUtilityDownloadTask has error status
Describe the bug
When AWSS3TransferUtility
handles NSURLSession's
NSURLSessionTask
after app start (after force close), it handles such error without resuming download:
Error Domain=NSURLErrorDomain Code=-999 "(null)" UserInfo={NSURLErrorBackgroundTaskCancelledReasonKey=0, NSErrorFailingURLStringKey=https://s3.eu-central-1.amazonaws.com/..., NSURLSessionDownloadTaskResumeData=<3c3f786d ...>}
Code -999 means that task was cancelled, NSURLErrorBackgroundTaskCancelledReasonKey=0
means that user terminated an app manually. There is NSURLSessionDownloadTaskResumeData
value which has resume data to continue the download.
To Reproduce Steps to reproduce the behavior:
- Start a download using
AWSS3TransferUtility
. - Force terminate an App, when handling
UIApplicationWillTerminateNotification
, suspend ongoing download. - When app didFinishLaunchingWithOptions: register utility with the same key as before
- Scan utility's getDownloadTasks.result in completionHandler of
+(void)registerS3TransferUtilityWithConfiguration...
- There is the task with the error above.
Which AWS service(s) are affected? S3
Expected behavior
What I expect is that AWSS3TransferIUtility's
getDownloadTasks.result
will return AWSS3TransferUtilityDownloadTask
task with paused status and upon resume, it continues from where it was suspended.
Environment(please complete the following information):
- SDK Version: 2.6.32
- Dependency Manager: Cocoapods
- Swift Version : Objective-C
Device Information (please complete the following information):
- Device: iPod touch
- iOS Version: 11.4.1
- Specific to simulators: no
Additional context BTW, using resume data above you can resume download process by invoking
(NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData*)resumeData
This one was created with @cbommas blessing - https://github.com/aws/aws-sdk-ios/issues/1047#issuecomment-430369830
@SanCHEESE I am marking this as a feature request and will post back here once I have a timeline that I can share.
any updates? 😻
Bump for updates :)
Thanks for opening this feature request. We don't plan on adding support for this feature at this time.