From c24633e99761686de8a5dc1c4f15d695a34b3584 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 23 Dec 2025 16:54:26 -0500 Subject: [PATCH] fix streams backpressure condition check --- src/workerd/api/streams/standard.c++ | 2 +- src/wpt/streams-test.ts | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/workerd/api/streams/standard.c++ b/src/workerd/api/streams/standard.c++ index 35d7efdcd08..428ad03d9d8 100644 --- a/src/workerd/api/streams/standard.c++ +++ b/src/workerd/api/streams/standard.c++ @@ -1499,7 +1499,7 @@ template void WritableImpl::updateBackpressure(jsg::Lock& js) { KJ_ASSERT(isWritable()); KJ_ASSERT(!isCloseQueuedOrInFlight()); - bool bp = getDesiredSize() < 0; + bool bp = getDesiredSize() <= 0; if (bp != flags.backpressure) { flags.backpressure = bp; diff --git a/src/wpt/streams-test.ts b/src/wpt/streams-test.ts index a36a2159135..96519c26ed3 100644 --- a/src/wpt/streams-test.ts +++ b/src/wpt/streams-test.ts @@ -751,7 +751,6 @@ export default { expectedFailures: [ 'start: errors in start cause WritableStream constructor to throw', 'write: returning a rejected promise (second write) should cause writer write() and ready to reject', - 'write: returning a promise that becomes rejected after the writer write() should cause writer write() and ready to reject', ], }, 'writable-streams/byte-length-queuing-strategy.any.js': { @@ -764,7 +763,6 @@ export default { 'writable-streams/close.any.js': { comment: 'To be investigated', expectedFailures: [ - 'when close is called on a WritableStream in waiting state, ready promise should be fulfilled', 'releaseLock() should not change the result of sync close()', ], }, @@ -817,10 +815,5 @@ export default { "underlying sink's write or close should not be called if start throws", ], }, - 'writable-streams/write.any.js': { - comment: 'To be investigated', - expectedFailures: [ - 'WritableStream should transition to waiting until write is acknowledged', - ], - }, + 'writable-streams/write.any.js': {}, } satisfies TestRunnerConfig;