Repository navigation
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📝 WalkthroughWalkthroughNode/uWebSockets streaming now shares Promise-based writable waiting across fixed-length and chunked responses. Fixed-length pumping retries partial writes, cancels stalled reads on abort, and cleans up cancellation hooks. Tests cover backpressure, registration reuse, offsets, and abort behavior. ChangesWritable backpressure coordination
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ReadableStream
participant handleFixedLengthStream
participant HttpResponse
ReadableStream->>handleFixedLengthStream: read chunk
handleFixedLengthStream->>HttpResponse: tryEnd chunk
HttpResponse-->>handleFixedLengthStream: partial write
handleFixedLengthStream->>HttpResponse: waitWritable
HttpResponse-->>handleFixedLengthStream: onWritable wake
handleFixedLengthStream->>HttpResponse: retry remaining bytes
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
de7ccbb to
350c5bf
Compare
350c5bf to
d1b114e
Compare
|
Closing as no longer relevant: the packages this changes are removed in #367 (part of the Effect migration stack). |
Closes #271
What was broken
The fixed-length response path in
packages/transports/src/http-server/node.tsregisteredonWritablefor every source chunk. uWS honors only the first registration, so later backpressure could leave a new waiter unresolved while a stale callback retried with the wrong chunk offset.The fixed-length reader also lacked the abort-side body cancellation used by the chunked path, leaving a stalled
reader.read()and its lock alive after client abort.Fix
Tests
packages/transports/tests/neemata/http/node-runtime.spec.ts.Verification
pnpm vitest run packages/transports/tests/http-server/fixed-length-stream.spec.ts packages/transports/tests/neemata/http/node-runtime.spec.ts --reporter=agent(11 tests passed)pnpm vitest run --project @nmtjs/transports --reporter=agent(239 tests passed)pnpm run fmtpnpm run check