Re: [whatwg/streams] Refactor writable stream erroring to be centralized (#705)

domenic commented on this pull request.



>    stream._state = 'errored';
   stream._storedError = error;
 
-  WritableStreamRejectPromisesInReactionToError(stream);
+  // TODO: layering violation?
+  ResetQueue(stream._writableStreamController);

@tyoshino the stream is not supposed to reach into its controller like this, right? What do you suggest for fixing this?

>    const abortRequest = stream._pendingAbortRequest;
   stream._pendingAbortRequest = undefined;
   const promise = WritableStreamDefaultControllerAbort(stream._writableStreamController, abortRequest._reason);
   promise.then(
     abortRequest._resolve,
     abortRequest._reject
   );
+  stream._backpressure = false;

This feels a little hacky. It is necessary to make sure we go down the "reset the ready promise" path inside WritableStreamError, instead of the "reject the ready promise" path. Is there a better way?

The reason it doesn't feel terrible is that yeah, we're now processing an abort request, so there's not really any backpressure I guess...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/705#pullrequestreview-28863705

Received on Friday, 24 March 2017 10:02:14 UTC