improve spec compliance on WritableStreamDefaultWriterRelease#6219
improve spec compliance on WritableStreamDefaultWriterRelease#6219
Conversation
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This PR fixes WritableStreamDefaultWriterRelease to reject the ready promise (not just closed) when a writer is released, matching the WHATWG Streams spec.
Issue: Missing WPT expected-failure cleanup (medium severity)
The writable-streams/general.any.js entry in src/wpt/streams-test.ts (lines 938-943) still lists two expected failures:
'closed and ready on a released writer''ready promise should fire before closed on releaseLock'
Both test the exact behavior this PR adds — rejecting the ready promise on writer release, in the correct spec order (ready before closed). With this fix, these WPTs should now pass. Please verify and remove them from expectedFailures (changing the entry to just 'writable-streams/general.any.js': {}). Leaving stale expected failures masks future regressions and hides that this fix actually works.
The C++ change itself looks correct: maybeRejectPromise safely no-ops when the fulfiller is already consumed (closed/errored states), and the rejection order (ready then closed) matches the spec.
|
Review posted successfully. Here's what I found: The C++ change in The one actionable issue I flagged: the |
jasnell
left a comment
There was a problem hiding this comment.
LGTM modulo consideration about whether this needs a compat flag or not. I'd like to see an argument about why a compat flag is not needed.
|
/bigbonk roast this pr |
|
Alright, I've now reviewed the entire PR thoroughly. Time to deliver. The RoastYagiz, my brother. You titled this PR "improve spec compliance on WritableStreamDefaultWriterRelease" and then proceeded to fix four different spec compliance issues scattered across writer setup, writer release, write-after-release, and write algorithm microtask ordering. The title is technically correct in the same way that "some weather happened" is a correct description of a hurricane. Commit hygiene: Two commits - "improve spec compliance on WritableStreamDefaultWriterRelease" and "improve spec compliance on streams." I see you ran out of thesaurus entries for "improve spec compliance" after exactly two commits. The first commit adds expected failures for The compat flag tango: James asked "does this need a compat flag?" You said "nah, it just fixes a hanging promise." James pushed back with "but what about The The The WPT cleanup: Bonk flagged it, you did it. The What's actually good: The core logic is correct. Rejecting ready before closed on release matches the spec. The backpressure-based ready resolution in TL;DR: Solid spec compliance work hiding behind a misleading title, with a compat flag that was added under gentle peer pressure, and a sneaky dependency on |
No description provided.