Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Resuming uploads with uploadDataDuringCreation resets uploads to latest chunk #494

Open
JammingBen opened this issue Oct 21, 2022 · 1 comment
Labels

Comments

@JammingBen
Copy link

Describe the bug
When having the uploadDataDuringCreation option set to true, pausing and resuming an upload resets the upload to the latest successfully uploaded chunk. That's especially bad when no chunk has been uploaded yet, meaning the upload would start over.

To Reproduce

  1. Set uploadDataDuringCreation to true
  2. Set the chunk size to Infinite
  3. Start upload, wait a bit
  4. Pause it
  5. Resume it

Expected behavior
The upload gets resumed right where it was paused.

Setup details

  • Runtime environment: Chrome, implementation in our Vue app via Uppy
  • Used tus-js-client version: 3.0.0
@JammingBen JammingBen added the bug label Oct 21, 2022
@Acconut
Copy link
Member

Acconut commented Oct 29, 2022

This is not a bug but the expected behavior. If you set uploadDataDuringCreation and interrupt the upload before the initial POST request finishes, tus-js-client will not be able to receive the response. Therefore, it does not know the upload URL and cannot resume. Instead it must start a new upload.

You should only use uploadDataDuringCreation if it is acceptable for you to start a new upload in these cases. Note that you can also control the amount of data that is included in the initial POST request using the chunkSize option. It makes sense to limit the amount, so that you receive the upload URL before the entire file has been uploaded. For small files, you have the benefit of an upload in a single request, but for larger files you have the benefit of resumable uploads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants