Skip to content

fix: critical streaming bugs for request and response streaming#65

Merged
VikramAditya33 merged 1 commit into
mainfrom
fix/streaming
Apr 29, 2026
Merged

fix: critical streaming bugs for request and response streaming#65
VikramAditya33 merged 1 commit into
mainfrom
fix/streaming

Conversation

@VikramAditya33
Copy link
Copy Markdown
Collaborator

@VikramAditya33 VikramAditya33 commented Apr 29, 2026

Three critical bugs prevented HTTP streaming from working:

  1. Request streaming - Missing super.resume() caused connections to abort after first chunk. Fixed by calling both uwsRes.resume() and super.resume() to properly resume both uWS and Node.js Readable. Fixes Critical Bug; Request Body Streaming Not Working #63

  2. Binary content auto-parsing - Route registry eagerly parsed all content types including binary, preventing streaming. Fixed by skipping auto-parse for application/octet-stream and multipart. Fixes Route Registry Prevents Streaming for Binary Content #62

  3. Duplicate Content-Length - Manually setting header before tryEnd() which also sets it. Fixed by letting tryEnd() handle it automatically. Fixes Duplicate Content-Length Header in Response Streaming #64

Changes:

  • Fix resume()/pause() to handle both uWS and Node.js Readable
  • Skip auto-parsing for streaming content types
  • Remove manual Content-Length setting in stream()

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of streaming media types (multipart/form-data, application/octet-stream) with automatic detection
    • Enhanced streaming request/response control with better automatic content-length management
    • Eliminated unnecessary body parsing for streaming content types

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a14d2838-deb3-4e05-83c6-9fc1d46e4d93

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/streaming

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

uWestJS Benchmark Results

Scenario Express req/s Fastify req/s uWestJS req/s Express throughput Fastify throughput uWestJS throughput uWestJS vs Express uWestJS vs Fastify
compression 6.18k 4.32k 7.42k 3.25 MB/s 2.21 MB/s 3.41 MB/s 1.20x 1.72x
headers 13.20k 19.25k 48.54k 2.46 MB/s 3.60 MB/s 7.64 MB/s 3.68x 2.52x
hello-world 13.79k 20.69k 53.68k 2.29 MB/s 3.47 MB/s 5.32 MB/s 3.89x 2.60x
json-response 12.95k 19.01k 43.00k 3.53 MB/s 5.20 MB/s 10.50 MB/s 3.32x 2.26x
mixed-response 13.24k 18.84k 41.19k 3.06 MB/s 4.37 MB/s 8.33 MB/s 3.11x 2.19x
post-json 11.46k 11.32k 18.20k 2.12 MB/s 3.09 MB/s 3.09 MB/s 1.59x 1.61x
query-params 11.21k 17.34k 46.80k 2.47 MB/s 3.84 MB/s 6.29 MB/s 4.17x 2.70x
route-params 12.93k 18.66k 47.58k 2.95 MB/s 4.27 MB/s 9.48 MB/s 3.68x 2.55x
static-file 15.34k 19.24k 40.53k 152.29 MB/s 190.70 MB/s 401.11 MB/s 2.64x 2.11x

Three critical bugs prevented HTTP streaming from working:

1. Request streaming - Missing super.resume() caused connections to
   abort after first chunk. Fixed by calling both uwsRes.resume() and
   super.resume() to properly resume both uWS and Node.js Readable.

2. Binary content auto-parsing - Route registry eagerly parsed all
   content types including binary, preventing streaming. Fixed by
   skipping auto-parse for application/octet-stream and multipart.

3. Duplicate Content-Length - Manually setting header before tryEnd()
   which also sets it. Fixed by letting tryEnd() handle it automatically.

Changes:
- Fix resume()/pause() to handle both uWS and Node.js Readable
- Skip auto-parsing for streaming content types
- Remove manual Content-Length setting in stream()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant