undici icon indicating copy to clipboard operation
undici copied to clipboard

fix: don't call onConnect multiple times for sub handler

Open ronag opened this issue 1 year ago • 1 comments

Many sub-handlers (e.g. api-request) don't expect onConnect (or any other handler other than onData or onBodySent) to be called multiple times.

I'm not sure why/how we haven't caught this earlier. Should fail at https://github.com/nodejs/undici/blob/4013c4b8932e73728809e4106d5c9d9d40648031/lib/api/api-request.js#L73

ronag avatar Sep 24 '23 15:09 ronag

Codecov Report

Patch coverage: 81.48% and project coverage change: +1.24% :tada:

Comparison is base (d92d617) 85.73% compared to head (5b51e7f) 86.98%. Report is 42 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2285      +/-   ##
==========================================
+ Coverage   85.73%   86.98%   +1.24%     
==========================================
  Files          75       76       +1     
  Lines        6611     7714    +1103     
==========================================
+ Hits         5668     6710    +1042     
- Misses        943     1004      +61     
Files Changed Coverage Δ
lib/cache/cache.js 6.73% <0.00%> (+0.04%) :arrow_up:
lib/handler/RedirectHandler.js 86.36% <50.00%> (-4.89%) :arrow_down:
lib/websocket/websocket.js 92.01% <77.77%> (-1.22%) :arrow_down:
lib/core/util.js 94.49% <84.61%> (+1.27%) :arrow_up:
lib/api/abort-signal.js 100.00% <100.00%> (ø)
lib/api/readable.js 91.53% <100.00%> (+0.13%) :arrow_up:
lib/fetch/body.js 97.69% <100.00%> (+<0.01%) :arrow_up:
lib/fetch/index.js 85.90% <100.00%> (+0.58%) :arrow_up:
lib/fetch/request.js 90.94% <100.00%> (ø)
lib/fetch/util.js 87.97% <100.00%> (+1.75%) :arrow_up:

... and 11 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Sep 24 '23 15:09 codecov-commenter