[streams] Canceling tee'ed streams does not cancel original stream (#347)

The reader that is acquired from the original stream in the tee() method is never released:  https://streams.spec.whatwg.org/#tee-readable-stream, step 3.

I don't think this code is running in your tests: https://github.com/whatwg/streams/blob/master/reference-implementation/test/readable-stream-tee.js#L147-L148.  I think the promise returned from canceling your tee'ed steams is being rejected because the call to cancel() on the original steam is rejecting due to the fact that the stream is still locked.

In the reference implementation, I think the code here https://github.com/whatwg/streams/blob/master/reference-implementation/lib/readable-stream.js#L693-L695 and here https://github.com/whatwg/streams/blob/master/reference-implementation/lib/readable-stream.js#L709-L711 needs to release the reader before calling CancelReadableStream.



---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/347

Received on Friday, 24 April 2015 22:40:12 UTC