Comments (3)
@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.
@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.
@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)
- can you provide a function to store the base url in the client. HOT 2
- buster test --node fails to run HOT 1
- timeout interceptor --> mime-deserialization error HOT 3
- HTTPS self-signed certificate ignore option needed HOT 4
- Dead link HOT 1
- Fetch API HOT 2
- ReferenceError: location is not defined when running application HOT 1
- Interceptor is not a function in wrap in client.js
- Does this library can be set to get responseType to "arraybuffer" HOT 4
- gzip entity interceptor HOT 1
- Why are _embedded and _links non-enumerable? HOT 1
- returned request.method is empty in interceptor HOT 3
- Interceptor does not reject on "connection refused" HOT 2
- mime-serialization error with custom mime converter HOT 2
- XHR sends string 'undefined' as request body in IE11 HOT 1
- Default params cannot be overwritten HOT 1
- Usage from nodejs is really slow HOT 1
- Access methods of interceptor HOT 3
- Add maxTries property to the retry interceptor HOT 1
- responseType: 'arraybuffer' causes 'Failed to read the 'responseText' error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rest.