Skip to content

fix(net): prevent reusing unpatched sockets - #800

Merged
kettanaito merged 6 commits into
feat/net-v2from
bug-unpatched-socket
Jul 14, 2026
Merged

kettanaito merged 6 commits into
feat/net-v2from
bug-unpatched-socket

Conversation

@mikicho

@mikicho mikicho commented Jul 13, 2026

Copy link
Copy Markdown
Member

No description provided.

@kettanaito

Copy link
Copy Markdown
Member

This is tricky to handle because despite my initial assumptions, connection on the socket interceptor will not be emitted since the socket that does the second request was never patched, in the first place. My initial proposal to use a symbol to detect such scenarios also fails since it relied on the connection event emitting anyway and then us checking the symbol.

I have two thoughts:

  • Consider the concept of "pausing" the interception. Only a partial fix since it still matters when you enable it.
  • Consider patching Agent so it could do the checks without doing anything else. Somewhat problematic due to default/custom agents and all of that hassle I'd rather not manage.

@kettanaito kettanaito changed the title fix(http): intercept requests that reuse a socket created before interceptor.apply() fix(http): prevent reusing unpatched sockets Jul 14, 2026
@kettanaito kettanaito changed the title fix(http): prevent reusing unpatched sockets fix(net): prevent reusing unpatched sockets Jul 14, 2026
@kettanaito
kettanaito merged commit cb879bb into feat/net-v2 Jul 14, 2026
4 of 5 checks passed
@kettanaito
kettanaito deleted the bug-unpatched-socket branch July 14, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants