You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The upload of a file does not continue correctly after killing and restarting the app.
Steps to reproduce the error
Start TUSKitExample and select a large file to upload (e.g. 150MB)
Go to the iOS home screen and close the app with the swipe gesture
Restart TUSKitExample. The upload will not be continued
Close TUSKitExample again and restart it. The upload will now continue.
Tested with iOS 18.3
Unfortunately, the error is not forwarded to the TUSClientDelegate so that the user is not aware of it.
Short analysis
The following method is called within Self.tusClient.start(): api.checkTaskExists and then session.getAllTasks. session.getAllTasks returns the previous task even after a kill of the app.
completion(hasTask) therefore returns true.
However, the task immediately ends in a failed. However, the error is not passed to the user at this point:
class: TUSClient.swift Method: reregisterCallbacks
self.api.registerCallback({ result in
task.taskCompleted(result: result, completed: { _ in })
}, forMetadata: metadata)
The error here is the following: failure(TUSKit.TUSClientError.couldNotUploadFile(underlyingError: TUSKit.TUSAPIError.underlyingError(Error Domain=NSURLErrorDomain Code=-999 "(null)" UserInfo={NSURLErrorBackgroundTaskCancelledReasonKey=0, NSErrorFailingURLStringKey=myurl, NSErrorFailingURLKey=myurl, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"BackgroundUploadTask <7B808DB7-FC94-48A5-B803-B749BD220559>.<4>",
"LocalUploadTask <7B808DB7-FC94-48A5-B803-B749BD220559>.<4>"
), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundUploadTask <7B808DB7-FC94-48A5-B803-B749BD220559>.<4>})))
It would be good if the error also ends up in the TUSClientDelegate or the error is handled internally so that the upload is continued.
The text was updated successfully, but these errors were encountered:
Hi @dennismoje Thanks for opening this issue, I'll take a look at this soon (it's on my todo list but I've been out sick for almost two weeks so it's taking some time to catch up on everything)
Hi @dennismoje, I'm investigating this still, what's interesting is that there's different behavior when I restart from Xcode vs when I manually launch the app.
Restarting from Xcode causes the upload to be automatically retried
Restarting manually shows me what you're describing.
I'm looking into what could be causing this exactly and I intend to get the manual launch to behave the same way as launching from Xcode directly
The upload of a file does not continue correctly after killing and restarting the app.
Steps to reproduce the error
Tested with iOS 18.3
Unfortunately, the error is not forwarded to the
TUSClientDelegate
so that the user is not aware of it.Short analysis
The following method is called within
Self.tusClient.start()
:api.checkTaskExists
and thensession.getAllTasks
.session.getAllTasks
returns the previous task even after a kill of the app.completion(hasTask) therefore returns
true
.However, the task immediately ends in a
failed
. However, the error is not passed to the user at this point:The error here is the following:
failure(TUSKit.TUSClientError.couldNotUploadFile(underlyingError: TUSKit.TUSAPIError.underlyingError(Error Domain=NSURLErrorDomain Code=-999 "(null)" UserInfo={NSURLErrorBackgroundTaskCancelledReasonKey=0, NSErrorFailingURLStringKey=myurl, NSErrorFailingURLKey=myurl, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"BackgroundUploadTask <7B808DB7-FC94-48A5-B803-B749BD220559>.<4>",
"LocalUploadTask <7B808DB7-FC94-48A5-B803-B749BD220559>.<4>"
), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundUploadTask <7B808DB7-FC94-48A5-B803-B749BD220559>.<4>})))
It would be good if the error also ends up in the
TUSClientDelegate
or the error is handled internally so that the upload is continued.The text was updated successfully, but these errors were encountered: