{"action":"closed","issue":{"url":"https://api.github.com/repos/maxogden/websocket-stream/issues/56","labels_url":"https://api.github.com/repos/maxogden/websocket-stream/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/maxogden/websocket-stream/issues/56/comments","events_url":"https://api.github.com/repos/maxogden/websocket-stream/issues/56/events","html_url":"https://github.com/maxogden/websocket-stream/issues/56","id":54017282,"number":56,"title":"After first writeOrBuffer() state.writing remains true all the time","user":{"login":"binarykitchen","id":177641,"avatar_url":"https://avatars.githubusercontent.com/u/177641?v=3","gravatar_id":"","url":"https://api.github.com/users/binarykitchen","html_url":"https://github.com/binarykitchen","followers_url":"https://api.github.com/users/binarykitchen/followers","following_url":"https://api.github.com/users/binarykitchen/following{/other_user}","gists_url":"https://api.github.com/users/binarykitchen/gists{/gist_id}","starred_url":"https://api.github.com/users/binarykitchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binarykitchen/subscriptions","organizations_url":"https://api.github.com/users/binarykitchen/orgs","repos_url":"https://api.github.com/users/binarykitchen/repos","events_url":"https://api.github.com/users/binarykitchen/events{/privacy}","received_events_url":"https://api.github.com/users/binarykitchen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-01-12T03:18:16Z","updated_at":"2015-01-12T11:06:32Z","closed_at":"2015-01-12T11:06:32Z","body":"This is a tricky problem and I cannot locate the bug. Somehow, after upgrading to `\"websocket-stream\": \"^1.3.0\"`, my client can write only once and then nothing happens.\r\n\r\nAfter some debugging I found out that `state.writing` is always true after the first write operation. This in writeOrBuffer() of `./node_modules/websocket-stream/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js`\r\n\r\n```\r\n  if (state.writing || state.corked)\r\n    state.buffer.push(new WriteReq(chunk, encoding, cb));\r\n  else\r\n    doWrite(stream, state, false, len, chunk, encoding, cb);\r\n```\r\n\r\nIn other words, after the first write operation, everything else is pushed in the buffer and nothing happens. Any clues?"}}