Files
bun.sh/test/js
Claude Bot 699d8474df Fix body-stream test hang and ReadableStream.Ref ownership issues
This commit fixes several issues with the new ReadableStream.Ref system
that caused body-stream tests to hang:

1. **Body.zig:1020** - Fixed owner mismatch when setting stream after draining
   - Was using `.strong` owner when should use actual owner (Request/Response)
   - This caused Ref.get() to fail since Ref type didn't match owner type

2. **Body.zig:964,1026** - Set proper Ref type for cloned bodies
   - When tee() returns streams via array, cloned body gets proper Ref type
   - Ensures cloned body can access its stream via GC cache

3. **Request.zig:819** - Fixed stream assignment in doClone
   - Stream[0] should go to original request, not cloned request

4. **ReadableStream.zig:108** - Always update original Ref after tee()
   - Original body's Ref must point to its tee'd stream

5. **body-stream.test.ts** - Fixed test discovery hang
   - Changed from eager to lazy array creation using factory function
   - Prevents creating hundreds of 2MB arrays during test discovery
   - Arrays now created on-demand when each test runs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-04 14:46:01 +00:00
..