restify / node-restify

The future of Node.js REST development

Home Page:http://restify.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node 16 socket issue for Legacy Restify v6

avimar opened this issue · comments

  • [ x ] Searched both open and closed issues for duplicates of this issue
  • [ x ] Title adequately and concisely reflects the feature or the bug

Restify Version: 6.4.0
Node.js Version: 16x

Expected behaviour

HTTP requests to the server should work

Actual behaviour

Requests don't return data

Repro case

Cause

fix: use more reliable close event
The close event from the request object is not guaranteed to fire on the
same order across major versions of Node.js, the more accurate way to
look if the connection was closed is to listen to the event on the
socket. Fixes tests on v16.
e183e5d

Please backport this bugfix to the legacy 6x branch & NPM package.

Yes, 6.x is super old. But due to the major routing change discussed in #1685 I've not updated restify.

We are experiencing this exact same issue and did not upgrade to a newer version due to similar reasons.

This fix is not working for me in node 18. Any other changes that I need to make?