Robert Nagy

Results 379 comments of Robert Nagy

When does `'drain'` actually get emitted? Is it when the queue is empty or when the queue.size < queue.capacity?

That’s doesn’t sound optimal.

I think the following needs to be changed: https://github.com/jshttp/on-finished/blob/master/index.js#L70 To ```js return Boolean((!socket && msg.finished) || (socket && !socket.writable)) ``` i.e. `!socket`, since `detachSocket` will be called on response completion...

> What do you think the assumptions are of this library? > The listener will be invoked only once when the response finished. If the response finished to an error,...

Yes, I've further raised issues over at nodejs. https://github.com/nodejs/node/pull/28411 https://github.com/nodejs/node/issues/28412 I'm not actually sure what the best course of action here is. This is a potentially very subtle bug. Fixing...

This is only a problem if an `error` occurs **after** calling `.end()` on the response object. At the moment it is unclear to me whether or when this could actually...

This PR does make the situation better. But it does not fully solve the issue. If `end()` is called before `socket` is emitted it will still give a false positive....

Ok, I think I've found a way that catches all edge cases and also doesn't break http/2 compat.

```(!socket && msg.finished && msg.outputSize === 0)``` `!socket` is true if msg has not connected or has closed `msg.finished` checks that `end()` has been called `msg.outputSize === 0` checks that...