Files
bun.sh/test/regression
Claude Bot 4c27d0df04 fix(node:https): ensure all chunks are yielded in streaming body
Fix a race condition in the node:https ClientRequest streaming body
where chunks could be lost when using request-promise + fs.createReadStream()
for multipart uploads.

The issue occurred because:
1. When multiple chunks were pushed to kBodyChunks between Promise resolutions
   in the async generator, only one chunk was yielded per iteration
2. When the request finished (self.finished = true), any remaining chunks in
   kBodyChunks were not yielded before the generator returned

This fix adds two safety loops:
1. After each Promise resolution, yield any remaining chunks that were pushed
2. After the main loop exits, yield any chunks that remain in the buffer

This is particularly important for HTTPS connections where the TLS handshake
delay can cause timing differences between when data is piped and when it's
consumed by the stream.

Fixes #26638

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:05:01 +00:00
..