deno icon indicating copy to clipboard operation
deno copied to clipboard

Possible regression on Socket `remoteAddress`

Open SebastienGllmt opened this issue 2 months ago • 2 comments

Version: Deno 2.5.0

Previous state of things

Previously, there was a bug where remoteAddress was missing in the Socket type inside a IncomingMessageForServer (fixed by #18733): see code

Where things went wrong

In #19660, this field started no longer being set directly on the IncomingMessageForServer type, and instead put inside a FakeSocket type instead

During refactoring in #25021, this code has since been replaced with a direct Socket | FakeSocket type

This Socket type, however, does not have the remoteAddress polyfill (see code), and so this only gets added in the FakeSocket branch

Why this didn't get caught

This hasn't been caught because tests use a FakeSocket type that does have the polyfill (see test in #21998): see code

What I'm not sure about

IncomingMessageForServer is seemingly only ever used with a FakeSocket and never a real Socket (code) so maybe looking at the wrong place for the source of my issue

SebastienGllmt avatar Sep 13 '25 18:09 SebastienGllmt