You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When a request aborts with a timeout, it calls the callback twice resulting in a message being printed on the console "superagent: double callback bug"
Expected behavior
Should not print the console message and should not call the callback twice
Unfortunately, this timeout error doens't happen always but most of the time. I debugged this a bit and the second callback error that causes the message is:
Error: aborted
at connResetException (node:internal/errors:717:14)
at TLSSocket.socketCloseListener (node:_http_client:462:19)
at TLSSocket.emit (node:events:525:35)
at node:net:322:12
at TCP.done (node:_tls_wrap:588:7) {
code: 'ECONNRESET'
}
In the case of a premature connection close after the response is received, the following events will be emitted in the following order:
'socket'
'response'
'data' any number of times, on the res object
(connection closed here)
'aborted' on the res object
'error' on the res object with an error with message 'Error: aborted' and code 'ECONNRESET'
'close'
'close' on the res object
Describe the bug
Node.js version: v18.16.0
OS version: ubuntu 22.04
Description:
When a request aborts with a timeout, it calls the callback twice resulting in a message being printed on the console "superagent: double callback bug"
Expected behavior
Should not print the console message and should not call the callback twice
Code to reproduce
Output (with DEBUG=*) :
Checklist
The text was updated successfully, but these errors were encountered: