23 / resumable.js

A JavaScript library for providing multiple simultaneous, stable, fault-tolerant and resumable/restartable uploads via the HTML5 File API.
MIT License
4.65k stars 611 forks source link

Retrying files doesn't seem to work #586

Open borekl opened 3 years ago

borekl commented 3 years ago

I am trying to figure out resending files that were not uploaded to the server because of an (perma)error. To test this I have written a backend, that will randomly drop some of the files with a 500 response:

sub upload ($c)
{
  if(rand(10) > 5) {
    $c->render(status => 200, text => 'Upload accepted');
  } else {
    $c->render(status => 500, text => 'Upload refused');
  }
}

Unfortunately, calling retry() on all files that failed and reissuing upload() on Resumable instance doesn't do anything (no network activity, there is just "uploadStart" and "completed" events fired). What am I missing? Also, can I somehow know if ResumableFile upload succeeded or failed after the upload process completed?

Edit: Hm, I think one can only invoke retry() after the upload has completed. I guess you can close this.