Comments (5)
I figured the immediate resolution was intended, since that's also the behavior for when delay
is 0.
Also, the createTimeout
returns either null
, a non-resolving Promise
, a {start, clear}
object, or an inscrutable wrapper promise. And it has an argument called signal
which seems to be given an AbortController
, not an AbortSignal
?
This code is an impressive fractal of WTF!
from agent.
Thanks @rotu! Core feedback addressed.
First array element is now thrown:
Lines 149 to 151 in d3187c4
util.js
has been removed, and I couldn't find any non-resolving Promises.
from agent.
Due to the way once works, this expression throws an Array containing a single Error instead of the probably intended Error.
This is a mistake and should be fixed. Nice catch!
This code creates a non-resolving promise (maybe instead of an immediately-resolving Promise?).
This could use a comment, or a refactor. This code path is only used in a Promise.race
so passing a non-resolving promise is done on purpose if no timeout is passed in. Using an immediately resolving promise would make it immediately resolve the Promise.race
which is not what is wanted.
from agent.
If the promise never resolves, what is it racing?
from agent.
oh ... if no timeout is passed. We should just return the original promise then.
ETA I think a bit of a refactor is in order here too. These are good catches!
from agent.
Related Issues (12)
- feat: implement socks proxy
- todo: test behaviors of uri encoded auth HOT 1
- todo: evaluate using a simple tunnel instead of the CONNECT method for http
- feat: more granular timeout configuration
- feat: move dns cache from make-fetch-happen to here
- [BUG] Fails to connect http url using https proxy
- [BUG] agent.js caches proxy w/o respect for credentials HOT 1
- pass family and lookup to socks-proxy-agent socket_options
- [BUG] windows 18.8.0 tests fail
- [BUG] tests fail in node 20
- [BUG] proxy behavior change introduced in #59 – appears to always use HttpProxyAgent 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 agent.