Giter VIP home page Giter VIP logo

Comments (3)

scothis avatar scothis commented on July 17, 2024

@DaniHaag I'm curious, what caused you to notice this behavior? It was intentional to not explicitly set the timeout attribute on the XHR object. One of the fun aspects of rest.js is that we try to decouple the client engines from interceptors in order to keep the interceptors portable across different engines; not all engines are cancelable. For timeout in particular, the physical timeout is managed within the interceptor, which then invokes request.cancel(), https://github.com/cujojs/rest/blob/master/interceptor/timeout.js#L41-L43, the cancel method will attempt to abort the XHR, https://github.com/cujojs/rest/blob/master/client/xhr.js#L97-L101, instead of having it hang open.

There may be a bug in the cancel/abort behavior if it wasn't working in your situation.

from rest.

DaniHaag avatar DaniHaag commented on July 17, 2024

@scothis: The issue is only reproducable on on remote system behind an IHS (Apache) proxy. The requests there have a very high latency and for some reasons the connection is dropped for some of the requests. IE8 was the only browser not cancelling the requests in this case. After the first dropped request I did not see any more requests on a packet sniffier, that I locally installed. Unfortunately I can not mock the behavior.

from rest.

scothis avatar scothis commented on July 17, 2024

@DaniHaag I'm going to close this issue. I really don't want to complicate the client.

In this case, I'd recommend creating a custom interceptor that sets request.mixins.timeout to the value of request.timeout. The request.mixins are mixed onto the XHR object, thus setting the timeout.

This is fine if you know you are in an XHR environment, I just can't do it globally since the behavior would break with other clients. Please continue to comment here if you run into issues.

from rest.

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.