Giter Club home page Giter Club logo

Comments (6)

KieranP avatar KieranP commented on May 29, 2024

For whatever reason, this no longer seems to be happening, and it's now properly creating the file rather than trying to resume a broken one. Very weird. Closing ticket...

from tus-js-client.

Acconut avatar Acconut commented on May 29, 2024

For whatever reason, this no longer seems to be happening, and it's now properly creating the file rather than trying to resume a broken one. Very weird. Closing ticket...

Could it be that you upgraded tus-js-client in the meantime? In the beginning, the module did not create a new upload if the previous one returned a 404. However, we changed this behavior some time ago for exactly the reason you named in your comment. It may be worth looking at the code to understand how it's handled now: https://github.com/tus/tus-js-client/blob/master/lib/upload.js#L309-L320

from tus-js-client.

KieranP avatar KieranP commented on May 29, 2024

@Acconut I was using the latest version on the master branch of this repo at the time I made the ticket.

I tracked it down to the tus-ruby-server returning a 404 for the OPTIONS call the browser makes before the HEAD request. Returning 404 at that stage causes the browser to reject with code 500 the HEAD request on a file url for security reasons, and tus-js then picks up that 500 and aborts.

I've reached out to the maintainer of the tus-ruby-server here: janko/tus-ruby-server#2

What I haven't done yet is check whether the spec says a tus server should return 404 or not on options calls where the file is missing, cause if the spec specifies this, then obviously it's going to fail :-(

from tus-js-client.

Acconut avatar Acconut commented on May 29, 2024

I tracked it down to the tus-ruby-server returning a 404 for the OPTIONS call the browser makes before the HEAD request. Returning 404 at that stage causes the browser to reject with code 500 the HEAD request on a file url for security reasons, and tus-js then picks up that 500 and aborts.

You should be able to circumvent this issue by using the retryDelays setting (https://github.com/tus/tus-js-client#tusdefaultoptions). When enabled it will not error out when a server returns the 500 status code but instead will start a new upload.

What I haven't done yet is check whether the spec says a tus server should return 404 or not on options calls where the file is missing, cause if the spec specifies this, then obviously it's going to fail :-(

The specification does not mention this case but I will investigate whether we should add a sentence about it.

from tus-js-client.

KieranP avatar KieranP commented on May 29, 2024

@Acconut I made the change I suggested (options always returning 404), and now the whole system is working perfectly. I would highly recommend adding something to that effect in the spec so other implementations don't run into the same issue.

from tus-js-client.

Acconut avatar Acconut commented on May 29, 2024

Closing in favor of tus/tus-resumable-upload-protocol#102.

from tus-js-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.