Add setValue calls in doClone to properly initialize Ref with tee'd streams

Addresses CodeRabbit review comment: doClone must call setValue on both
the original and cloned Request's Locked.readable Ref after setting the
GC cache, mirroring the constructor pattern. This ensures the Ref is
properly initialized with the tee'd stream value, making the body stream
accessible via the owner-aware get() path.
This commit is contained in:
Claude Bot
2025-10-05 04:47:12 +00:00
parent 53c301d727
commit 100b7fcd9f

View File

@@ -828,10 +828,12 @@ pub fn doClone(
if (js_wrapper != .zero) {
if (this.body.value == .Locked and readable_stream_tee[0] != .zero) {
js.gc.body.set(this_value, globalThis, readable_stream_tee[0]);
this.body.value.Locked.readable.setValue(.{ .Request = this_value }, readable_stream_tee[0], globalThis);
}
if (cloned.body.value == .Locked and readable_stream_tee[1] != .zero) {
js.gc.body.set(js_wrapper, globalThis, readable_stream_tee[1]);
cloned.body.value.Locked.readable.setValue(.{ .Request = js_wrapper }, readable_stream_tee[1], globalThis);
}
}