Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix/queue breaks on failure #92

Merged
merged 11 commits into from
Mar 8, 2021

Conversation

hannojg
Copy link

@hannojg hannojg commented Mar 3, 2021

What this PR fixes

When integrating the TUSKit into our app we realised that our TUS-Server was not configured correctly. The create method failed. This broke the queue as it hasn't been marked as .ready again.

Changes introduced to fix this:

  • TUSUploadStatus has now a new value called failed
  • TUSClient has a new function called pendingUploads() which returns all currentUploads filtered by any failed uploads. This function is used where we check for e.g. the next upload
  • TUSExecutor when create fails cancel is called with failed: true which marks the upload as failed
  • Example app: Only call resumeAll when the user hasn't selected any files

@MMasterson
Copy link
Contributor

Hey @hannojg thanks for this PR - just like the other, should have time to review tomorrow! Thanks for making so many contributions!

@hannojg
Copy link
Author

hannojg commented Mar 4, 2021

Great!

I just fixed another issue (in 9e59405) where the queue would hang up in uploading state. It happened when the response from the upload path request can't be parsed. This is now handled, and the upload is marked as failed.

(just also noticed that this happens when the request e.g. times out, so its very useful to have this handling in place 😄 )

@hannojg
Copy link
Author

hannojg commented Mar 4, 2021

Fixed another issue where it wasn't checking correctly when an upload has failed whether we should continue uploading in respect to the background (mode) execution.
In the executor, there is now a helper function called continueUploading which checks whether there is more to upload. It is used in the success case and failure case.

@MMasterson MMasterson merged commit f92b0ae into tus:swift-development Mar 8, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants