{"action":"created","issue":{"url":"https://api.github.com/repos/whatwg/streams/issues/646","repository_url":"https://api.github.com/repos/whatwg/streams","labels_url":"https://api.github.com/repos/whatwg/streams/issues/646/labels{/name}","comments_url":"https://api.github.com/repos/whatwg/streams/issues/646/comments","events_url":"https://api.github.com/repos/whatwg/streams/issues/646/events","html_url":"https://github.com/whatwg/streams/issues/646","id":200242330,"number":646,"title":"Constructing a readable byte stream can reach code that assumes a default reader","user":{"login":"domenic","id":617481,"avatar_url":"https://avatars.githubusercontent.com/u/617481?v=3","gravatar_id":"","url":"https://api.github.com/users/domenic","html_url":"https://github.com/domenic","followers_url":"https://api.github.com/users/domenic/followers","following_url":"https://api.github.com/users/domenic/following{/other_user}","gists_url":"https://api.github.com/users/domenic/gists{/gist_id}","starred_url":"https://api.github.com/users/domenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domenic/subscriptions","organizations_url":"https://api.github.com/users/domenic/orgs","repos_url":"https://api.github.com/users/domenic/repos","events_url":"https://api.github.com/users/domenic/events{/privacy}","received_events_url":"https://api.github.com/users/domenic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-11T23:55:54Z","updated_at":"2017-01-12T04:30:19Z","closed_at":null,"body":"Found by @tschneidereit:\r\n\r\n- [new ReadableStreamDefaultController](https://streams.spec.whatwg.org/#rs-default-controller-constructor) step 11.a.iv. ->\r\n- [ReadableStreamDefaultControllerCallPullIfNeeded](https://streams.spec.whatwg.org/#readable-stream-default-controller-call-pull-if-needed) step 1 ->\r\n- [ReadableStreamDefaultControllerShouldCallPull](https://streams.spec.whatwg.org/#readable-stream-default-controller-should-call-pull) step 5 ->\r\n- [ReadableStreamGetNumReadRequests](https://streams.spec.whatwg.org/#readable-stream-get-num-read-requests) which assumes _stream_.[[reader]].[[readRequests]] exists, which is not true for byte readers.\r\n\r\nUntested, but I think the repro code is then something like:\r\n\r\n```js\r\nconst rs = new ReadableStream({ type: \"bytes\" });\r\nconst reader = rs.getReader();\r\n```\r\n\r\n@tschneidereit mentions that his Gecko implementation is failing the test \"ReadableStream with byte source: autoAllocateChunkSize\", whereas the reference implementation for some reason is not.\r\n\r\n---\r\n\r\nI think the correct fix here is to bail in ReadableStreamDefaultControllerCallPullIfNeeded immediately if the reader is not a default reader. @tyoshino, does that sound right? We should also track down the missing test coverage though."},"comment":{"url":"https://api.github.com/repos/whatwg/streams/issues/comments/272073512","html_url":"https://github.com/whatwg/streams/issues/646#issuecomment-272073512","issue_url":"https://api.github.com/repos/whatwg/streams/issues/646","id":272073512,"user":{"login":"domenic","id":617481,"avatar_url":"https://avatars.githubusercontent.com/u/617481?v=3","gravatar_id":"","url":"https://api.github.com/users/domenic","html_url":"https://github.com/domenic","followers_url":"https://api.github.com/users/domenic/followers","following_url":"https://api.github.com/users/domenic/following{/other_user}","gists_url":"https://api.github.com/users/domenic/gists{/gist_id}","starred_url":"https://api.github.com/users/domenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domenic/subscriptions","organizations_url":"https://api.github.com/users/domenic/orgs","repos_url":"https://api.github.com/users/domenic/repos","events_url":"https://api.github.com/users/domenic/events{/privacy}","received_events_url":"https://api.github.com/users/domenic/received_events","type":"User","site_admin":false},"created_at":"2017-01-12T04:30:19Z","updated_at":"2017-01-12T04:30:19Z","body":"Maybe it is a problem with the tape framework in particular; I think the web platform tests are generally good at catching these sorts of things."}}
{"actor":{"display_login":"domenic"}}