{"action":"created","issue":{"url":"https://api.github.com/repos/websockets/ws/issues/1418","repository_url":"https://api.github.com/repos/websockets/ws","labels_url":"https://api.github.com/repos/websockets/ws/issues/1418/labels{/name}","comments_url":"https://api.github.com/repos/websockets/ws/issues/1418/comments","events_url":"https://api.github.com/repos/websockets/ws/issues/1418/events","html_url":"https://github.com/websockets/ws/issues/1418","id":340252024,"node_id":"MDU6SXNzdWUzNDAyNTIwMjQ=","number":1418,"title":"Use of this[kWebSocket] after it was undefined in socketOnData()","user":{"login":"jpambrun","id":718384,"node_id":"MDQ6VXNlcjcxODM4NA==","avatar_url":"https://avatars0.githubusercontent.com/u/718384?v=4","gravatar_id":"","url":"https://api.github.com/users/jpambrun","html_url":"https://github.com/jpambrun","followers_url":"https://api.github.com/users/jpambrun/followers","following_url":"https://api.github.com/users/jpambrun/following{/other_user}","gists_url":"https://api.github.com/users/jpambrun/gists{/gist_id}","starred_url":"https://api.github.com/users/jpambrun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpambrun/subscriptions","organizations_url":"https://api.github.com/users/jpambrun/orgs","repos_url":"https://api.github.com/users/jpambrun/repos","events_url":"https://api.github.com/users/jpambrun/events{/privacy}","received_events_url":"https://api.github.com/users/jpambrun/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-07-11T13:52:30Z","updated_at":"2018-07-11T20:34:33Z","closed_at":"2018-07-11T19:42:32Z","author_association":"NONE","body":"- [x] I've searched for any related issues and avoided creating a duplicate issue.\r\n\r\n#### Description\r\n\r\nUse ```this[kWebSocket]._receiver.write(chunk)``` in [socketOnData (chunk)](https://github.com/websockets/ws/blob/master/lib/websocket.js#L793) after ```this[kWebSocket]``` was set to undefined in [socketOnClose ()](https://github.com/websockets/ws/blob/master/lib/websocket.js#L755)\r\n\r\nIt might be related to the ```websocket._socket.read()``` after ```this[kWebSocket] = undefined``` at [websocket.js#L769](https://github.com/websockets/ws/blob/master/lib/websocket.js#L769)\r\n\r\n#### Reproducible in:\r\n\r\nversion: 5.21\r\nElectron version: 2.0.4\r\nOS version(s): Linux\r\n\r\n#### Steps to reproduce:\r\n\r\nNot 100% sure. Close the socket while fragments are still coming in? \r\n\r\n### Expected result:\r\n\r\nNo 'cannot read property X of undefined exception' in the library.\r\n\r\n### Actual result:\r\n\r\nException thrown.\r\n"},"comment":{"url":"https://api.github.com/repos/websockets/ws/issues/comments/404300973","html_url":"https://github.com/websockets/ws/issues/1418#issuecomment-404300973","issue_url":"https://api.github.com/repos/websockets/ws/issues/1418","id":404300973,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDMwMDk3Mw==","user":{"login":"jpambrun","id":718384,"node_id":"MDQ6VXNlcjcxODM4NA==","avatar_url":"https://avatars0.githubusercontent.com/u/718384?v=4","gravatar_id":"","url":"https://api.github.com/users/jpambrun","html_url":"https://github.com/jpambrun","followers_url":"https://api.github.com/users/jpambrun/followers","following_url":"https://api.github.com/users/jpambrun/following{/other_user}","gists_url":"https://api.github.com/users/jpambrun/gists{/gist_id}","starred_url":"https://api.github.com/users/jpambrun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpambrun/subscriptions","organizations_url":"https://api.github.com/users/jpambrun/orgs","repos_url":"https://api.github.com/users/jpambrun/repos","events_url":"https://api.github.com/users/jpambrun/events{/privacy}","received_events_url":"https://api.github.com/users/jpambrun/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T20:34:33Z","updated_at":"2018-07-11T20:34:33Z","author_association":"NONE","body":"Yep, that did it. Thanks for the unbelievably fast response. "}}
{"actor":{"display_login":"jpambrun"}}