{"action":"created","comment":{"url":"https://api.github.com/repos/nats-io/node-nats/pulls/comments/174268498","pull_request_review_id":103591590,"id":174268498,"diff_hunk":"@@ -1003,6 +992,57 @@ Client.prototype.processInbound = function() {\n     }\n };\n \n+/**\n+ * Process server updates in info object\n+ * @api internal\n+ */\n+Client.prototype.processServerUpdate = function() {\n+  var client = this;\n+  if (client.info.connect_urls && client.info.connect_urls.length > 0) {\n+    // parse the infos\n+    var tmp = {};\n+    client.info.connect_urls.forEach(function(server) {\n+      var u = 'nats://' + server;\n+      var s = new Server(url.parse(u));\n+      // implicit servers are ones added via the info connect_urls\n+      s.implicit = true;\n+      tmp[s.url.href] = s;\n+    });\n+\n+    // remove implicit servers that are no longer reported\n+    var toDelete = [];\n+    client.servers.forEach(function(s, index) {\n+      var u = s.url.href;\n+      if(s.implicit && client.currentServer.url.href !== u && tmp[u] === undefined) {\n+        // server was removed\n+        toDelete.push(index);\n+      }\n+      // remove this entry from reported\n+      delete tmp[u];\n+    });\n+\n+    // perform the deletion\n+    toDelete.reverse();\n+    toDelete.forEach(function(index) {\n+      client.servers.splice(index, 1);\n+    });\n+\n+    // remaining servers are new\n+    var newURLs = [];\n+    for(var k in tmp) {\n+      if(tmp.hasOwnProperty(k)) {","path":"lib/nats.js","position":125,"original_position":125,"commit_id":"289f80e769356dee6de8bda07e9715cb2700a1a8","original_commit_id":"289f80e769356dee6de8bda07e9715cb2700a1a8","user":{"login":"kozlovic","id":13736691,"avatar_url":"https://avatars3.githubusercontent.com/u/13736691?v=4","gravatar_id":"","url":"https://api.github.com/users/kozlovic","html_url":"https://github.com/kozlovic","followers_url":"https://api.github.com/users/kozlovic/followers","following_url":"https://api.github.com/users/kozlovic/following{/other_user}","gists_url":"https://api.github.com/users/kozlovic/gists{/gist_id}","starred_url":"https://api.github.com/users/kozlovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kozlovic/subscriptions","organizations_url":"https://api.github.com/users/kozlovic/orgs","repos_url":"https://api.github.com/users/kozlovic/repos","events_url":"https://api.github.com/users/kozlovic/events{/privacy}","received_events_url":"https://api.github.com/users/kozlovic/received_events","type":"User","site_admin":false},"body":"What does that mean?\r\nAt this point, you should add to server pool all the URLs that are in `tmp`, and detect the ones that were never seen before, so that we pass those to the `serverDiscovered` callback.\r\nI can't say if this is what this code is doing here...","created_at":"2018-03-13T20:11:55Z","updated_at":"2018-03-13T20:13:58Z","html_url":"https://github.com/nats-io/node-nats/pull/213#discussion_r174268498","pull_request_url":"https://api.github.com/repos/nats-io/node-nats/pulls/213","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/nats-io/node-nats/pulls/comments/174268498"},"html":{"href":"https://github.com/nats-io/node-nats/pull/213#discussion_r174268498"},"pull_request":{"href":"https://api.github.com/repos/nats-io/node-nats/pulls/213"}}},"pull_request":{"url":"https://api.github.com/repos/nats-io/node-nats/pulls/213","id":174772098,"html_url":"https://github.com/nats-io/node-nats/pull/213","diff_url":"https://github.com/nats-io/node-nats/pull/213.diff","patch_url":"https://github.com/nats-io/node-nats/pull/213.patch","issue_url":"https://api.github.com/repos/nats-io/node-nats/issues/213","number":213,"state":"open","locked":false,"title":"Server pool update","user":{"login":"aricart","id":1032976,"avatar_url":"https://avatars0.githubusercontent.com/u/1032976?v=4","gravatar_id":"","url":"https://api.github.com/users/aricart","html_url":"https://github.com/aricart","followers_url":"https://api.github.com/users/aricart/followers","following_url":"https://api.github.com/users/aricart/following{/other_user}","gists_url":"https://api.github.com/users/aricart/gists{/gist_id}","starred_url":"https://api.github.com/users/aricart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aricart/subscriptions","organizations_url":"https://api.github.com/users/aricart/orgs","repos_url":"https://api.github.com/users/aricart/repos","events_url":"https://api.github.com/users/aricart/events{/privacy}","received_events_url":"https://api.github.com/users/aricart/received_events","type":"User","site_admin":false},"body":"server pool update enhancements.","created_at":"2018-03-13T19:54:50Z","updated_at":"2018-03-13T20:13:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"070d3449a64b6720db4c479d0a24baf3330806ec","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nats-io/node-nats/pulls/213/commits","review_comments_url":"https://api.github.com/repos/nats-io/node-nats/pulls/213/comments","review_comment_url":"https://api.github.com/repos/nats-io/node-nats/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nats-io/node-nats/issues/213/comments","statuses_url":"https://api.github.com/repos/nats-io/node-nats/statuses/289f80e769356dee6de8bda07e9715cb2700a1a8","head":{"label":"nats-io:server-pool-update","ref":"server-pool-update","sha":"289f80e769356dee6de8bda07e9715cb2700a1a8","user":{"login":"nats-io","id":10203055,"avatar_url":"https://avatars2.githubusercontent.com/u/10203055?v=4","gravatar_id":"","url":"https://api.github.com/users/nats-io","html_url":"https://github.com/nats-io","followers_url":"https://api.github.com/users/nats-io/followers","following_url":"https://api.github.com/users/nats-io/following{/other_user}","gists_url":"https://api.github.com/users/nats-io/gists{/gist_id}","starred_url":"https://api.github.com/users/nats-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nats-io/subscriptions","organizations_url":"https://api.github.com/users/nats-io/orgs","repos_url":"https://api.github.com/users/nats-io/repos","events_url":"https://api.github.com/users/nats-io/events{/privacy}","received_events_url":"https://api.github.com/users/nats-io/received_events","type":"Organization","site_admin":false},"repo":{"id":3043048,"name":"node-nats","full_name":"nats-io/node-nats","owner":{"login":"nats-io","id":10203055,"avatar_url":"https://avatars2.githubusercontent.com/u/10203055?v=4","gravatar_id":"","url":"https://api.github.com/users/nats-io","html_url":"https://github.com/nats-io","followers_url":"https://api.github.com/users/nats-io/followers","following_url":"https://api.github.com/users/nats-io/following{/other_user}","gists_url":"https://api.github.com/users/nats-io/gists{/gist_id}","starred_url":"https://api.github.com/users/nats-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nats-io/subscriptions","organizations_url":"https://api.github.com/users/nats-io/orgs","repos_url":"https://api.github.com/users/nats-io/repos","events_url":"https://api.github.com/users/nats-io/events{/privacy}","received_events_url":"https://api.github.com/users/nats-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nats-io/node-nats","description":"Node.js client for NATS, the cloud native messaging system.","fork":false,"url":"https://api.github.com/repos/nats-io/node-nats","forks_url":"https://api.github.com/repos/nats-io/node-nats/forks","keys_url":"https://api.github.com/repos/nats-io/node-nats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nats-io/node-nats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nats-io/node-nats/teams","hooks_url":"https://api.github.com/repos/nats-io/node-nats/hooks","issue_events_url":"https://api.github.com/repos/nats-io/node-nats/issues/events{/number}","events_url":"https://api.github.com/repos/nats-io/node-nats/events","assignees_url":"https://api.github.com/repos/nats-io/node-nats/assignees{/user}","branches_url":"https://api.github.com/repos/nats-io/node-nats/branches{/branch}","tags_url":"https://api.github.com/repos/nats-io/node-nats/tags","blobs_url":"https://api.github.com/repos/nats-io/node-nats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nats-io/node-nats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nats-io/node-nats/git/refs{/sha}","trees_url":"https://api.github.com/repos/nats-io/node-nats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nats-io/node-nats/statuses/{sha}","languages_url":"https://api.github.com/repos/nats-io/node-nats/languages","stargazers_url":"https://api.github.com/repos/nats-io/node-nats/stargazers","contributors_url":"https://api.github.com/repos/nats-io/node-nats/contributors","subscribers_url":"https://api.github.com/repos/nats-io/node-nats/subscribers","subscription_url":"https://api.github.com/repos/nats-io/node-nats/subscription","commits_url":"https://api.github.com/repos/nats-io/node-nats/commits{/sha}","git_commits_url":"https://api.github.com/repos/nats-io/node-nats/git/commits{/sha}","comments_url":"https://api.github.com/repos/nats-io/node-nats/comments{/number}","issue_comment_url":"https://api.github.com/repos/nats-io/node-nats/issues/comments{/number}","contents_url":"https://api.github.com/repos/nats-io/node-nats/contents/{+path}","compare_url":"https://api.github.com/repos/nats-io/node-nats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nats-io/node-nats/merges","archive_url":"https://api.github.com/repos/nats-io/node-nats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nats-io/node-nats/downloads","issues_url":"https://api.github.com/repos/nats-io/node-nats/issues{/number}","pulls_url":"https://api.github.com/repos/nats-io/node-nats/pulls{/number}","milestones_url":"https://api.github.com/repos/nats-io/node-nats/milestones{/number}","notifications_url":"https://api.github.com/repos/nats-io/node-nats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nats-io/node-nats/labels{/name}","releases_url":"https://api.github.com/repos/nats-io/node-nats/releases{/id}","deployments_url":"https://api.github.com/repos/nats-io/node-nats/deployments","created_at":"2011-12-24T00:43:57Z","updated_at":"2018-03-13T16:40:34Z","pushed_at":"2018-03-13T19:54:51Z","git_url":"git://github.com/nats-io/node-nats.git","ssh_url":"git@github.com:nats-io/node-nats.git","clone_url":"https://github.com/nats-io/node-nats.git","svn_url":"https://github.com/nats-io/node-nats","homepage":"https://nats.io","size":408,"stargazers_count":433,"watchers_count":433,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":72,"open_issues":11,"watchers":433,"default_branch":"master"}},"base":{"label":"nats-io:master","ref":"master","sha":"fac1fcc355355a0110fb80425cc2caf87ee8221a","user":{"login":"nats-io","id":10203055,"avatar_url":"https://avatars2.githubusercontent.com/u/10203055?v=4","gravatar_id":"","url":"https://api.github.com/users/nats-io","html_url":"https://github.com/nats-io","followers_url":"https://api.github.com/users/nats-io/followers","following_url":"https://api.github.com/users/nats-io/following{/other_user}","gists_url":"https://api.github.com/users/nats-io/gists{/gist_id}","starred_url":"https://api.github.com/users/nats-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nats-io/subscriptions","organizations_url":"https://api.github.com/users/nats-io/orgs","repos_url":"https://api.github.com/users/nats-io/repos","events_url":"https://api.github.com/users/nats-io/events{/privacy}","received_events_url":"https://api.github.com/users/nats-io/received_events","type":"Organization","site_admin":false},"repo":{"id":3043048,"name":"node-nats","full_name":"nats-io/node-nats","owner":{"login":"nats-io","id":10203055,"avatar_url":"https://avatars2.githubusercontent.com/u/10203055?v=4","gravatar_id":"","url":"https://api.github.com/users/nats-io","html_url":"https://github.com/nats-io","followers_url":"https://api.github.com/users/nats-io/followers","following_url":"https://api.github.com/users/nats-io/following{/other_user}","gists_url":"https://api.github.com/users/nats-io/gists{/gist_id}","starred_url":"https://api.github.com/users/nats-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nats-io/subscriptions","organizations_url":"https://api.github.com/users/nats-io/orgs","repos_url":"https://api.github.com/users/nats-io/repos","events_url":"https://api.github.com/users/nats-io/events{/privacy}","received_events_url":"https://api.github.com/users/nats-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nats-io/node-nats","description":"Node.js client for NATS, the cloud native messaging system.","fork":false,"url":"https://api.github.com/repos/nats-io/node-nats","forks_url":"https://api.github.com/repos/nats-io/node-nats/forks","keys_url":"https://api.github.com/repos/nats-io/node-nats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nats-io/node-nats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nats-io/node-nats/teams","hooks_url":"https://api.github.com/repos/nats-io/node-nats/hooks","issue_events_url":"https://api.github.com/repos/nats-io/node-nats/issues/events{/number}","events_url":"https://api.github.com/repos/nats-io/node-nats/events","assignees_url":"https://api.github.com/repos/nats-io/node-nats/assignees{/user}","branches_url":"https://api.github.com/repos/nats-io/node-nats/branches{/branch}","tags_url":"https://api.github.com/repos/nats-io/node-nats/tags","blobs_url":"https://api.github.com/repos/nats-io/node-nats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nats-io/node-nats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nats-io/node-nats/git/refs{/sha}","trees_url":"https://api.github.com/repos/nats-io/node-nats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nats-io/node-nats/statuses/{sha}","languages_url":"https://api.github.com/repos/nats-io/node-nats/languages","stargazers_url":"https://api.github.com/repos/nats-io/node-nats/stargazers","contributors_url":"https://api.github.com/repos/nats-io/node-nats/contributors","subscribers_url":"https://api.github.com/repos/nats-io/node-nats/subscribers","subscription_url":"https://api.github.com/repos/nats-io/node-nats/subscription","commits_url":"https://api.github.com/repos/nats-io/node-nats/commits{/sha}","git_commits_url":"https://api.github.com/repos/nats-io/node-nats/git/commits{/sha}","comments_url":"https://api.github.com/repos/nats-io/node-nats/comments{/number}","issue_comment_url":"https://api.github.com/repos/nats-io/node-nats/issues/comments{/number}","contents_url":"https://api.github.com/repos/nats-io/node-nats/contents/{+path}","compare_url":"https://api.github.com/repos/nats-io/node-nats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nats-io/node-nats/merges","archive_url":"https://api.github.com/repos/nats-io/node-nats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nats-io/node-nats/downloads","issues_url":"https://api.github.com/repos/nats-io/node-nats/issues{/number}","pulls_url":"https://api.github.com/repos/nats-io/node-nats/pulls{/number}","milestones_url":"https://api.github.com/repos/nats-io/node-nats/milestones{/number}","notifications_url":"https://api.github.com/repos/nats-io/node-nats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nats-io/node-nats/labels{/name}","releases_url":"https://api.github.com/repos/nats-io/node-nats/releases{/id}","deployments_url":"https://api.github.com/repos/nats-io/node-nats/deployments","created_at":"2011-12-24T00:43:57Z","updated_at":"2018-03-13T16:40:34Z","pushed_at":"2018-03-13T19:54:51Z","git_url":"git://github.com/nats-io/node-nats.git","ssh_url":"git@github.com:nats-io/node-nats.git","clone_url":"https://github.com/nats-io/node-nats.git","svn_url":"https://github.com/nats-io/node-nats","homepage":"https://nats.io","size":408,"stargazers_count":433,"watchers_count":433,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":72,"open_issues":11,"watchers":433,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nats-io/node-nats/pulls/213"},"html":{"href":"https://github.com/nats-io/node-nats/pull/213"},"issue":{"href":"https://api.github.com/repos/nats-io/node-nats/issues/213"},"comments":{"href":"https://api.github.com/repos/nats-io/node-nats/issues/213/comments"},"review_comments":{"href":"https://api.github.com/repos/nats-io/node-nats/pulls/213/comments"},"review_comment":{"href":"https://api.github.com/repos/nats-io/node-nats/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nats-io/node-nats/pulls/213/commits"},"statuses":{"href":"https://api.github.com/repos/nats-io/node-nats/statuses/289f80e769356dee6de8bda07e9715cb2700a1a8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kozlovic"}}