{"action":"created","comment":{"url":"https://api.github.com/repos/strongloop/strong-control-channel/pulls/comments/33952978","id":33952978,"diff_hunk":"@@ -126,10 +138,13 @@ WebsocketChannel.prototype._detach = function() {\n \n \n WebsocketChannel.prototype.close = function(callback) {\n+  this._debug('close');\n+\n   if (this._websocket) {\n     this._unscheduleSendAck();\n     this._flushSendQueue();\n     this._closeWebsocket(this._websocket);\n+    this._websocket = null;","path":"lib/ws-channel.js","position":79,"original_position":79,"commit_id":"82b2104af7668bca52e1941ab5310a86f10c7e49","original_commit_id":"82b2104af7668bca52e1941ab5310a86f10c7e49","user":{"login":"piscisaureus","id":218257,"avatar_url":"https://avatars.githubusercontent.com/u/218257?v=3","gravatar_id":"","url":"https://api.github.com/users/piscisaureus","html_url":"https://github.com/piscisaureus","followers_url":"https://api.github.com/users/piscisaureus/followers","following_url":"https://api.github.com/users/piscisaureus/following{/other_user}","gists_url":"https://api.github.com/users/piscisaureus/gists{/gist_id}","starred_url":"https://api.github.com/users/piscisaureus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piscisaureus/subscriptions","organizations_url":"https://api.github.com/users/piscisaureus/orgs","repos_url":"https://api.github.com/users/piscisaureus/repos","events_url":"https://api.github.com/users/piscisaureus/events{/privacy}","received_events_url":"https://api.github.com/users/piscisaureus/received_events","type":"User","site_admin":false},"body":"This isn't right. The normal flow is `_closeWebsocket()` -> `_handleClose()` -> `detach()` -> remove listeners and nullify.\r\n\r\nYou could opt to call `_detach()` directly instead of waiting for the `close` event.\r\nBut I deliberately made it so that the `_websocket` property has the same lifecycle as the event listeners that we add to the WS object, and I'd like to keep it that way.","created_at":"2015-07-06T16:26:51Z","updated_at":"2015-07-06T16:26:51Z","html_url":"https://github.com/strongloop/strong-control-channel/pull/27#discussion_r33952978","pull_request_url":"https://api.github.com/repos/strongloop/strong-control-channel/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/strongloop/strong-control-channel/pulls/comments/33952978"},"html":{"href":"https://github.com/strongloop/strong-control-channel/pull/27#discussion_r33952978"},"pull_request":{"href":"https://api.github.com/repos/strongloop/strong-control-channel/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/strongloop/strong-control-channel/pulls/27","id":38703905,"html_url":"https://github.com/strongloop/strong-control-channel/pull/27","diff_url":"https://github.com/strongloop/strong-control-channel/pull/27.diff","patch_url":"https://github.com/strongloop/strong-control-channel/pull/27.patch","issue_url":"https://api.github.com/repos/strongloop/strong-control-channel/issues/27","number":27,"state":"open","locked":false,"title":"ws: add debug statements so state is debuggable","user":{"login":"sam-github","id":17607,"avatar_url":"https://avatars.githubusercontent.com/u/17607?v=3","gravatar_id":"","url":"https://api.github.com/users/sam-github","html_url":"https://github.com/sam-github","followers_url":"https://api.github.com/users/sam-github/followers","following_url":"https://api.github.com/users/sam-github/following{/other_user}","gists_url":"https://api.github.com/users/sam-github/gists{/gist_id}","starred_url":"https://api.github.com/users/sam-github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sam-github/subscriptions","organizations_url":"https://api.github.com/users/sam-github/orgs","repos_url":"https://api.github.com/users/sam-github/repos","events_url":"https://api.github.com/users/sam-github/events{/privacy}","received_events_url":"https://api.github.com/users/sam-github/received_events","type":"User","site_admin":false},"body":"connected to strongloop-internal/scrum-nodeops#754","created_at":"2015-06-27T04:42:14Z","updated_at":"2015-07-06T16:26:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ce1591c27cfa557d74b728e55b09f64d5af3931","assignee":{"login":"piscisaureus","id":218257,"avatar_url":"https://avatars.githubusercontent.com/u/218257?v=3","gravatar_id":"","url":"https://api.github.com/users/piscisaureus","html_url":"https://github.com/piscisaureus","followers_url":"https://api.github.com/users/piscisaureus/followers","following_url":"https://api.github.com/users/piscisaureus/following{/other_user}","gists_url":"https://api.github.com/users/piscisaureus/gists{/gist_id}","starred_url":"https://api.github.com/users/piscisaureus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piscisaureus/subscriptions","organizations_url":"https://api.github.com/users/piscisaureus/orgs","repos_url":"https://api.github.com/users/piscisaureus/repos","events_url":"https://api.github.com/users/piscisaureus/events{/privacy}","received_events_url":"https://api.github.com/users/piscisaureus/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/strongloop/strong-control-channel/pulls/27/commits","review_comments_url":"https://api.github.com/repos/strongloop/strong-control-channel/pulls/27/comments","review_comment_url":"https://api.github.com/repos/strongloop/strong-control-channel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/strongloop/strong-control-channel/issues/27/comments","statuses_url":"https://api.github.com/repos/strongloop/strong-control-channel/statuses/82b2104af7668bca52e1941ab5310a86f10c7e49","head":{"label":"strongloop:debug-everything","ref":"debug-everything","sha":"82b2104af7668bca52e1941ab5310a86f10c7e49","user":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":21912119,"name":"strong-control-channel","full_name":"strongloop/strong-control-channel","owner":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/strong-control-channel","description":"Run-time control channel for node applications","fork":false,"url":"https://api.github.com/repos/strongloop/strong-control-channel","forks_url":"https://api.github.com/repos/strongloop/strong-control-channel/forks","keys_url":"https://api.github.com/repos/strongloop/strong-control-channel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/strong-control-channel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/strong-control-channel/teams","hooks_url":"https://api.github.com/repos/strongloop/strong-control-channel/hooks","issue_events_url":"https://api.github.com/repos/strongloop/strong-control-channel/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/strong-control-channel/events","assignees_url":"https://api.github.com/repos/strongloop/strong-control-channel/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/strong-control-channel/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/strong-control-channel/tags","blobs_url":"https://api.github.com/repos/strongloop/strong-control-channel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/strong-control-channel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/strong-control-channel/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/strong-control-channel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/strong-control-channel/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/strong-control-channel/languages","stargazers_url":"https://api.github.com/repos/strongloop/strong-control-channel/stargazers","contributors_url":"https://api.github.com/repos/strongloop/strong-control-channel/contributors","subscribers_url":"https://api.github.com/repos/strongloop/strong-control-channel/subscribers","subscription_url":"https://api.github.com/repos/strongloop/strong-control-channel/subscription","commits_url":"https://api.github.com/repos/strongloop/strong-control-channel/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/strong-control-channel/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/strong-control-channel/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/strong-control-channel/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/strong-control-channel/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/strong-control-channel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/strong-control-channel/merges","archive_url":"https://api.github.com/repos/strongloop/strong-control-channel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/strong-control-channel/downloads","issues_url":"https://api.github.com/repos/strongloop/strong-control-channel/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/strong-control-channel/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/strong-control-channel/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/strong-control-channel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/strong-control-channel/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/strong-control-channel/releases{/id}","created_at":"2014-07-16T18:26:13Z","updated_at":"2015-06-19T15:12:58Z","pushed_at":"2015-07-03T21:29:18Z","git_url":"git://github.com/strongloop/strong-control-channel.git","ssh_url":"git@github.com:strongloop/strong-control-channel.git","clone_url":"https://github.com/strongloop/strong-control-channel.git","svn_url":"https://github.com/strongloop/strong-control-channel","homepage":null,"size":824,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":2,"default_branch":"master"}},"base":{"label":"strongloop:master","ref":"master","sha":"583bfdd51098a12ebc0fa14d3c58c406e56ac3dd","user":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":21912119,"name":"strong-control-channel","full_name":"strongloop/strong-control-channel","owner":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/strong-control-channel","description":"Run-time control channel for node applications","fork":false,"url":"https://api.github.com/repos/strongloop/strong-control-channel","forks_url":"https://api.github.com/repos/strongloop/strong-control-channel/forks","keys_url":"https://api.github.com/repos/strongloop/strong-control-channel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/strong-control-channel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/strong-control-channel/teams","hooks_url":"https://api.github.com/repos/strongloop/strong-control-channel/hooks","issue_events_url":"https://api.github.com/repos/strongloop/strong-control-channel/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/strong-control-channel/events","assignees_url":"https://api.github.com/repos/strongloop/strong-control-channel/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/strong-control-channel/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/strong-control-channel/tags","blobs_url":"https://api.github.com/repos/strongloop/strong-control-channel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/strong-control-channel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/strong-control-channel/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/strong-control-channel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/strong-control-channel/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/strong-control-channel/languages","stargazers_url":"https://api.github.com/repos/strongloop/strong-control-channel/stargazers","contributors_url":"https://api.github.com/repos/strongloop/strong-control-channel/contributors","subscribers_url":"https://api.github.com/repos/strongloop/strong-control-channel/subscribers","subscription_url":"https://api.github.com/repos/strongloop/strong-control-channel/subscription","commits_url":"https://api.github.com/repos/strongloop/strong-control-channel/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/strong-control-channel/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/strong-control-channel/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/strong-control-channel/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/strong-control-channel/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/strong-control-channel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/strong-control-channel/merges","archive_url":"https://api.github.com/repos/strongloop/strong-control-channel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/strong-control-channel/downloads","issues_url":"https://api.github.com/repos/strongloop/strong-control-channel/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/strong-control-channel/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/strong-control-channel/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/strong-control-channel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/strong-control-channel/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/strong-control-channel/releases{/id}","created_at":"2014-07-16T18:26:13Z","updated_at":"2015-06-19T15:12:58Z","pushed_at":"2015-07-03T21:29:18Z","git_url":"git://github.com/strongloop/strong-control-channel.git","ssh_url":"git@github.com:strongloop/strong-control-channel.git","clone_url":"https://github.com/strongloop/strong-control-channel.git","svn_url":"https://github.com/strongloop/strong-control-channel","homepage":null,"size":824,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/strongloop/strong-control-channel/pulls/27"},"html":{"href":"https://github.com/strongloop/strong-control-channel/pull/27"},"issue":{"href":"https://api.github.com/repos/strongloop/strong-control-channel/issues/27"},"comments":{"href":"https://api.github.com/repos/strongloop/strong-control-channel/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/strongloop/strong-control-channel/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/strongloop/strong-control-channel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/strongloop/strong-control-channel/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/strongloop/strong-control-channel/statuses/82b2104af7668bca52e1941ab5310a86f10c7e49"}}}}