Skip to content

fix: preserve queued request ordering after stream body errors#5336

Closed
mcollina wants to merge 1 commit into
mainfrom
fix/5335-stream-post-ordering
Closed

fix: preserve queued request ordering after stream body errors#5336
mcollina wants to merge 1 commit into
mainfrom
fix/5335-stream-post-ordering

Conversation

@mcollina
Copy link
Copy Markdown
Member

Summary

  • avoid eager HTTP/1 Readable body probing before undici attaches body/error handlers
  • restore strict client-errors expectations for the failed POST / queued GET ordering
  • stop tolerating extra POST attempts in the reconnect test

Fixes #5335.

Testing

  • node --test --test-reporter=spec --test-timeout=180000 test/node-test/client-errors.js
  • ~/.nvm/versions/node/v25.2.1/bin/node --test --test-reporter=spec --test-timeout=180000 test/node-test/client-errors.js
  • ~/.nvm/versions/node/v26.1.0/bin/node --test --test-reporter=spec --test-timeout=180000 test/node-test/client-errors.js
  • PATH="$HOME/.nvm/versions/node/v26.1.0/bin:$PATH" npm run test:node-test
  • npx eslint lib/dispatcher/client-h1.js test/node-test/client-errors.js

Signed-off-by: Matteo Collina <hello@matteocollina.com>
Comment on lines -1091 to -1095
if (body && typeof body.read === 'function') {
// Try to read EOF in order to get length.
body.read(0)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is problematic in some cases...

@mcollina mcollina closed this May 29, 2026
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.

Do not mask stream POST retry ordering in client-errors

2 participants