{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/socket.io/pulls/comments/24518111","id":24518111,"diff_hunk":"@@ -730,6 +730,55 @@ describe('socket.io', function(){\n         });\n       }\n     });\n+\n+    it('should find the correct clients on subsequent runs', function(done){\n+      var srv = http();\n+      var sio = io(srv);\n+      var chatFooSid = null;\n+      var chatBarSid = null;\n+      var otherSid = null;\n+      srv.listen(function(){\n+        var c1 = client(srv, '/chat');\n+        var c2 = client(srv, '/chat', {forceNew: true});\n+        var c3 = client(srv, '/other', {forceNew: true});\n+        var chatIndex = 0;\n+        var total = 3;\n+        sio.of('/chat').on('connection', function(socket){\n+          if (chatIndex++) {\n+            socket.join('foo', function() {\n+              chatFooSid = socket.id;\n+              --total || getClients();\n+            });\n+          } else {\n+            socket.join('bar', function() {\n+              chatBarSid = socket.id;\n+              --total || getClients();\n+            });\n+          }\n+        });\n+        sio.of('/other').on('connection', function(socket){\n+          socket.join('foo', function() {\n+            otherSid = socket.id;\n+            --total || getClients();\n+          });\n+        });\n+      });\n+      function getClients() {\n+        sio.of('/chat').in('foo').clients(function(error, sids) {\n+          expect(error).to.be.undefined;","path":"test/socket.io.js","position":39,"original_position":39,"commit_id":"6f8ec046a10c8254fc82e8c2eccdb3c5db4d1447","original_commit_id":"6f8ec046a10c8254fc82e8c2eccdb3c5db4d1447","user":{"login":"nkzawa","id":775227,"avatar_url":"https://avatars.githubusercontent.com/u/775227?v=3","gravatar_id":"","url":"https://api.github.com/users/nkzawa","html_url":"https://github.com/nkzawa","followers_url":"https://api.github.com/users/nkzawa/followers","following_url":"https://api.github.com/users/nkzawa/following{/other_user}","gists_url":"https://api.github.com/users/nkzawa/gists{/gist_id}","starred_url":"https://api.github.com/users/nkzawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkzawa/subscriptions","organizations_url":"https://api.github.com/users/nkzawa/orgs","repos_url":"https://api.github.com/users/nkzawa/repos","events_url":"https://api.github.com/users/nkzawa/events{/privacy}","received_events_url":"https://api.github.com/users/nkzawa/received_events","type":"User","site_admin":false},"body":"I believe there is no syntax like this on `expect.js`. It should be `expect().to.be(undefined)`.","created_at":"2015-02-11T18:15:12Z","updated_at":"2015-02-11T18:15:12Z","html_url":"https://github.com/Automattic/socket.io/pull/1978#discussion_r24518111","pull_request_url":"https://api.github.com/repos/Automattic/socket.io/pulls/1978","_links":{"self":{"href":"https://api.github.com/repos/Automattic/socket.io/pulls/comments/24518111"},"html":{"href":"https://github.com/Automattic/socket.io/pull/1978#discussion_r24518111"},"pull_request":{"href":"https://api.github.com/repos/Automattic/socket.io/pulls/1978"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/socket.io/pulls/1978","id":28554716,"html_url":"https://github.com/Automattic/socket.io/pull/1978","diff_url":"https://github.com/Automattic/socket.io/pull/1978.diff","patch_url":"https://github.com/Automattic/socket.io/pull/1978.patch","issue_url":"https://api.github.com/repos/Automattic/socket.io/issues/1978","number":1978,"state":"open","locked":false,"title":"Reset rooms array after each clients() call","user":{"login":"Nibbler999","id":935710,"avatar_url":"https://avatars.githubusercontent.com/u/935710?v=3","gravatar_id":"","url":"https://api.github.com/users/Nibbler999","html_url":"https://github.com/Nibbler999","followers_url":"https://api.github.com/users/Nibbler999/followers","following_url":"https://api.github.com/users/Nibbler999/following{/other_user}","gists_url":"https://api.github.com/users/Nibbler999/gists{/gist_id}","starred_url":"https://api.github.com/users/Nibbler999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nibbler999/subscriptions","organizations_url":"https://api.github.com/users/Nibbler999/orgs","repos_url":"https://api.github.com/users/Nibbler999/repos","events_url":"https://api.github.com/users/Nibbler999/events{/privacy}","received_events_url":"https://api.github.com/users/Nibbler999/received_events","type":"User","site_admin":false},"body":"If you call clients() multiple times with different rooms you end up with clients from all the rooms specified in previous calls.","created_at":"2015-02-03T14:10:42Z","updated_at":"2015-02-11T18:15:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93a5b24d6d24be42a22c29b115948b64cb00f521","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/socket.io/pulls/1978/commits","review_comments_url":"https://api.github.com/repos/Automattic/socket.io/pulls/1978/comments","review_comment_url":"https://api.github.com/repos/Automattic/socket.io/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Automattic/socket.io/issues/1978/comments","statuses_url":"https://api.github.com/repos/Automattic/socket.io/statuses/6f8ec046a10c8254fc82e8c2eccdb3c5db4d1447","head":{"label":"Nibbler999:clients-rooms","ref":"clients-rooms","sha":"6f8ec046a10c8254fc82e8c2eccdb3c5db4d1447","user":{"login":"Nibbler999","id":935710,"avatar_url":"https://avatars.githubusercontent.com/u/935710?v=3","gravatar_id":"","url":"https://api.github.com/users/Nibbler999","html_url":"https://github.com/Nibbler999","followers_url":"https://api.github.com/users/Nibbler999/followers","following_url":"https://api.github.com/users/Nibbler999/following{/other_user}","gists_url":"https://api.github.com/users/Nibbler999/gists{/gist_id}","starred_url":"https://api.github.com/users/Nibbler999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nibbler999/subscriptions","organizations_url":"https://api.github.com/users/Nibbler999/orgs","repos_url":"https://api.github.com/users/Nibbler999/repos","events_url":"https://api.github.com/users/Nibbler999/events{/privacy}","received_events_url":"https://api.github.com/users/Nibbler999/received_events","type":"User","site_admin":false},"repo":{"id":30245571,"name":"socket.io","full_name":"Nibbler999/socket.io","owner":{"login":"Nibbler999","id":935710,"avatar_url":"https://avatars.githubusercontent.com/u/935710?v=3","gravatar_id":"","url":"https://api.github.com/users/Nibbler999","html_url":"https://github.com/Nibbler999","followers_url":"https://api.github.com/users/Nibbler999/followers","following_url":"https://api.github.com/users/Nibbler999/following{/other_user}","gists_url":"https://api.github.com/users/Nibbler999/gists{/gist_id}","starred_url":"https://api.github.com/users/Nibbler999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nibbler999/subscriptions","organizations_url":"https://api.github.com/users/Nibbler999/orgs","repos_url":"https://api.github.com/users/Nibbler999/repos","events_url":"https://api.github.com/users/Nibbler999/events{/privacy}","received_events_url":"https://api.github.com/users/Nibbler999/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Nibbler999/socket.io","description":"Realtime application framework (Node.JS server)","fork":true,"url":"https://api.github.com/repos/Nibbler999/socket.io","forks_url":"https://api.github.com/repos/Nibbler999/socket.io/forks","keys_url":"https://api.github.com/repos/Nibbler999/socket.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nibbler999/socket.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nibbler999/socket.io/teams","hooks_url":"https://api.github.com/repos/Nibbler999/socket.io/hooks","issue_events_url":"https://api.github.com/repos/Nibbler999/socket.io/issues/events{/number}","events_url":"https://api.github.com/repos/Nibbler999/socket.io/events","assignees_url":"https://api.github.com/repos/Nibbler999/socket.io/assignees{/user}","branches_url":"https://api.github.com/repos/Nibbler999/socket.io/branches{/branch}","tags_url":"https://api.github.com/repos/Nibbler999/socket.io/tags","blobs_url":"https://api.github.com/repos/Nibbler999/socket.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nibbler999/socket.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nibbler999/socket.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nibbler999/socket.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nibbler999/socket.io/statuses/{sha}","languages_url":"https://api.github.com/repos/Nibbler999/socket.io/languages","stargazers_url":"https://api.github.com/repos/Nibbler999/socket.io/stargazers","contributors_url":"https://api.github.com/repos/Nibbler999/socket.io/contributors","subscribers_url":"https://api.github.com/repos/Nibbler999/socket.io/subscribers","subscription_url":"https://api.github.com/repos/Nibbler999/socket.io/subscription","commits_url":"https://api.github.com/repos/Nibbler999/socket.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nibbler999/socket.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nibbler999/socket.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nibbler999/socket.io/issues/comments/{number}","contents_url":"https://api.github.com/repos/Nibbler999/socket.io/contents/{+path}","compare_url":"https://api.github.com/repos/Nibbler999/socket.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nibbler999/socket.io/merges","archive_url":"https://api.github.com/repos/Nibbler999/socket.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nibbler999/socket.io/downloads","issues_url":"https://api.github.com/repos/Nibbler999/socket.io/issues{/number}","pulls_url":"https://api.github.com/repos/Nibbler999/socket.io/pulls{/number}","milestones_url":"https://api.github.com/repos/Nibbler999/socket.io/milestones{/number}","notifications_url":"https://api.github.com/repos/Nibbler999/socket.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nibbler999/socket.io/labels{/name}","releases_url":"https://api.github.com/repos/Nibbler999/socket.io/releases{/id}","created_at":"2015-02-03T14:05:38Z","updated_at":"2015-02-03T14:05:40Z","pushed_at":"2015-02-03T18:34:22Z","git_url":"git://github.com/Nibbler999/socket.io.git","ssh_url":"git@github.com:Nibbler999/socket.io.git","clone_url":"https://github.com/Nibbler999/socket.io.git","svn_url":"https://github.com/Nibbler999/socket.io","homepage":"http://socket.io","size":12152,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"3645741b86f12474cb6b90fefad3f2c405eef7f1","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":557980,"name":"socket.io","full_name":"Automattic/socket.io","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/socket.io","description":"Realtime application framework (Node.JS server)","fork":false,"url":"https://api.github.com/repos/Automattic/socket.io","forks_url":"https://api.github.com/repos/Automattic/socket.io/forks","keys_url":"https://api.github.com/repos/Automattic/socket.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/socket.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/socket.io/teams","hooks_url":"https://api.github.com/repos/Automattic/socket.io/hooks","issue_events_url":"https://api.github.com/repos/Automattic/socket.io/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/socket.io/events","assignees_url":"https://api.github.com/repos/Automattic/socket.io/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/socket.io/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/socket.io/tags","blobs_url":"https://api.github.com/repos/Automattic/socket.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/socket.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/socket.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/socket.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/socket.io/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/socket.io/languages","stargazers_url":"https://api.github.com/repos/Automattic/socket.io/stargazers","contributors_url":"https://api.github.com/repos/Automattic/socket.io/contributors","subscribers_url":"https://api.github.com/repos/Automattic/socket.io/subscribers","subscription_url":"https://api.github.com/repos/Automattic/socket.io/subscription","commits_url":"https://api.github.com/repos/Automattic/socket.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/socket.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/socket.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/socket.io/issues/comments/{number}","contents_url":"https://api.github.com/repos/Automattic/socket.io/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/socket.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/socket.io/merges","archive_url":"https://api.github.com/repos/Automattic/socket.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/socket.io/downloads","issues_url":"https://api.github.com/repos/Automattic/socket.io/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/socket.io/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/socket.io/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/socket.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/socket.io/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/socket.io/releases{/id}","created_at":"2010-03-11T18:24:48Z","updated_at":"2015-02-11T18:09:10Z","pushed_at":"2015-02-05T04:55:51Z","git_url":"git://github.com/Automattic/socket.io.git","ssh_url":"git@github.com:Automattic/socket.io.git","clone_url":"https://github.com/Automattic/socket.io.git","svn_url":"https://github.com/Automattic/socket.io","homepage":"http://socket.io","size":17611,"stargazers_count":15298,"watchers_count":15298,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2875,"mirror_url":null,"open_issues_count":134,"forks":2875,"open_issues":134,"watchers":15298,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/socket.io/pulls/1978"},"html":{"href":"https://github.com/Automattic/socket.io/pull/1978"},"issue":{"href":"https://api.github.com/repos/Automattic/socket.io/issues/1978"},"comments":{"href":"https://api.github.com/repos/Automattic/socket.io/issues/1978/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/socket.io/pulls/1978/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/socket.io/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Automattic/socket.io/pulls/1978/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/socket.io/statuses/6f8ec046a10c8254fc82e8c2eccdb3c5db4d1447"}}}}