Open JammingBen opened 2 years ago
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.
Describe the bug When having the
uploadDataDuringCreation
option set totrue
, 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
uploadDataDuringCreation
totrue
Infinite
Expected behavior The upload gets resumed right where it was paused.
Setup details
3.0.0