aws-sdk-ios icon indicating copy to clipboard operation
aws-sdk-ios copied to clipboard

If user force terminated app, suspended AWSS3TransferUtilityDownloadTask has error status

Open SanCHEESE opened this issue 6 years ago • 3 comments

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:

  1. Start a download using AWSS3TransferUtility.
  2. Force terminate an App, when handling UIApplicationWillTerminateNotification, suspend ongoing download.
  3. When app didFinishLaunchingWithOptions: register utility with the same key as before
  4. Scan utility's getDownloadTasks.result in completionHandler of +(void)registerS3TransferUtilityWithConfiguration...
  5. 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

SanCHEESE avatar Oct 17 '18 08:10 SanCHEESE

This one was created with @cbommas blessing - https://github.com/aws/aws-sdk-ios/issues/1047#issuecomment-430369830

SanCHEESE avatar Oct 17 '18 08:10 SanCHEESE

@SanCHEESE I am marking this as a feature request and will post back here once I have a timeline that I can share.

scb01 avatar Jan 17 '19 16:01 scb01

any updates? 😻

boek avatar Nov 01 '21 23:11 boek

Bump for updates :)

AlexGingell avatar Oct 12 '22 10:10 AlexGingell

Thanks for opening this feature request. We don't plan on adding support for this feature at this time.

atierian avatar Dec 06 '23 22:12 atierian