{"action":"created","comment":{"url":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls/comments/120849660","pull_request_review_id":42846817,"id":120849660,"diff_hunk":"@@ -12,11 +22,75 @@ function SocketIO(host, port, ssl) {\n    * @param {int} reconnectionDelay\n    */\n   this.connect = function (autoReconnect, reconnectionDelay) {\n+    var self = this;\n+\n     this.socket = window.io((this.ssl ? 'https://' : 'http://') + this.host + ':' + this.port, {\n       reconnection: autoReconnect,\n       reconnectionDelay: reconnectionDelay,\n       forceNew: true\n     });\n+\n+    this.socket.on('connect', function() {\n+      if (self.wasConnected) {","path":"src/networkWrapper/wrappers/socketio.js","position":30,"original_position":30,"commit_id":"ab465eea2b7061a4029a812cbb46b5154d83ddf2","original_commit_id":"321211f442a14dad8136a9ed4d3dee112905d63f","user":{"login":"benoitvidis","id":6680551,"avatar_url":"https://avatars0.githubusercontent.com/u/6680551?v=3","gravatar_id":"","url":"https://api.github.com/users/benoitvidis","html_url":"https://github.com/benoitvidis","followers_url":"https://api.github.com/users/benoitvidis/followers","following_url":"https://api.github.com/users/benoitvidis/following{/other_user}","gists_url":"https://api.github.com/users/benoitvidis/gists{/gist_id}","starred_url":"https://api.github.com/users/benoitvidis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benoitvidis/subscriptions","organizations_url":"https://api.github.com/users/benoitvidis/orgs","repos_url":"https://api.github.com/users/benoitvidis/repos","events_url":"https://api.github.com/users/benoitvidis/events{/privacy}","received_events_url":"https://api.github.com/users/benoitvidis/received_events","type":"User","site_admin":false},"body":"Well, I see that you intend to use them differently but this is not what the doc says. `connect` is fired each time a connection is made, including socket.io reconnections.","created_at":"2017-06-08T10:14:13Z","updated_at":"2017-06-08T10:14:31Z","html_url":"https://github.com/kuzzleio/sdk-javascript/pull/226#discussion_r120849660","pull_request_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls/226","_links":{"self":{"href":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls/comments/120849660"},"html":{"href":"https://github.com/kuzzleio/sdk-javascript/pull/226#discussion_r120849660"},"pull_request":{"href":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls/226"}}},"pull_request":{"url":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls/226","id":123523298,"html_url":"https://github.com/kuzzleio/sdk-javascript/pull/226","diff_url":"https://github.com/kuzzleio/sdk-javascript/pull/226.diff","patch_url":"https://github.com/kuzzleio/sdk-javascript/pull/226.patch","issue_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/issues/226","number":226,"state":"open","locked":false,"title":"Network error handling ","user":{"login":"stafyniaksacha","id":3911343,"avatar_url":"https://avatars1.githubusercontent.com/u/3911343?v=3","gravatar_id":"","url":"https://api.github.com/users/stafyniaksacha","html_url":"https://github.com/stafyniaksacha","followers_url":"https://api.github.com/users/stafyniaksacha/followers","following_url":"https://api.github.com/users/stafyniaksacha/following{/other_user}","gists_url":"https://api.github.com/users/stafyniaksacha/gists{/gist_id}","starred_url":"https://api.github.com/users/stafyniaksacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stafyniaksacha/subscriptions","organizations_url":"https://api.github.com/users/stafyniaksacha/orgs","repos_url":"https://api.github.com/users/stafyniaksacha/repos","events_url":"https://api.github.com/users/stafyniaksacha/events{/privacy}","received_events_url":"https://api.github.com/users/stafyniaksacha/received_events","type":"User","site_admin":false},"body":"## Bugfixes\r\n- SocketIO: handle network errors (like we do in Websocket protocol wrapper)\r\n- Websocket: arguments can differs from NodeJS and Browsers\r\n- Auto resubscribe when a reconnection occurs after a network error  ","created_at":"2017-06-01T15:10:19Z","updated_at":"2017-06-08T10:14:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d68d068ee8a8807d06c1e4718872e2a5fe7c38b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls/226/commits","review_comments_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls/226/comments","review_comment_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/issues/226/comments","statuses_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/statuses/ab465eea2b7061a4029a812cbb46b5154d83ddf2","head":{"label":"kuzzleio:network-error-handling","ref":"network-error-handling","sha":"ab465eea2b7061a4029a812cbb46b5154d83ddf2","user":{"login":"kuzzleio","id":12933347,"avatar_url":"https://avatars2.githubusercontent.com/u/12933347?v=3","gravatar_id":"","url":"https://api.github.com/users/kuzzleio","html_url":"https://github.com/kuzzleio","followers_url":"https://api.github.com/users/kuzzleio/followers","following_url":"https://api.github.com/users/kuzzleio/following{/other_user}","gists_url":"https://api.github.com/users/kuzzleio/gists{/gist_id}","starred_url":"https://api.github.com/users/kuzzleio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuzzleio/subscriptions","organizations_url":"https://api.github.com/users/kuzzleio/orgs","repos_url":"https://api.github.com/users/kuzzleio/repos","events_url":"https://api.github.com/users/kuzzleio/events{/privacy}","received_events_url":"https://api.github.com/users/kuzzleio/received_events","type":"Organization","site_admin":false},"repo":{"id":40353752,"name":"sdk-javascript","full_name":"kuzzleio/sdk-javascript","owner":{"login":"kuzzleio","id":12933347,"avatar_url":"https://avatars2.githubusercontent.com/u/12933347?v=3","gravatar_id":"","url":"https://api.github.com/users/kuzzleio","html_url":"https://github.com/kuzzleio","followers_url":"https://api.github.com/users/kuzzleio/followers","following_url":"https://api.github.com/users/kuzzleio/following{/other_user}","gists_url":"https://api.github.com/users/kuzzleio/gists{/gist_id}","starred_url":"https://api.github.com/users/kuzzleio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuzzleio/subscriptions","organizations_url":"https://api.github.com/users/kuzzleio/orgs","repos_url":"https://api.github.com/users/kuzzleio/repos","events_url":"https://api.github.com/users/kuzzleio/events{/privacy}","received_events_url":"https://api.github.com/users/kuzzleio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kuzzleio/sdk-javascript","description":"Official javascript SDK for Kuzzle","fork":false,"url":"https://api.github.com/repos/kuzzleio/sdk-javascript","forks_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/forks","keys_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/teams","hooks_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/hooks","issue_events_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/issues/events{/number}","events_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/events","assignees_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/assignees{/user}","branches_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/branches{/branch}","tags_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/tags","blobs_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/git/refs{/sha}","trees_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/statuses/{sha}","languages_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/languages","stargazers_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/stargazers","contributors_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/contributors","subscribers_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/subscribers","subscription_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/subscription","commits_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/commits{/sha}","git_commits_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/git/commits{/sha}","comments_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/comments{/number}","issue_comment_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/issues/comments{/number}","contents_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/contents/{+path}","compare_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/merges","archive_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/downloads","issues_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/issues{/number}","pulls_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls{/number}","milestones_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/milestones{/number}","notifications_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/labels{/name}","releases_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/releases{/id}","deployments_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/deployments","created_at":"2015-08-07T09:54:38Z","updated_at":"2017-05-24T20:50:32Z","pushed_at":"2017-06-08T10:05:30Z","git_url":"git://github.com/kuzzleio/sdk-javascript.git","ssh_url":"git@github.com:kuzzleio/sdk-javascript.git","clone_url":"https://github.com/kuzzleio/sdk-javascript.git","svn_url":"https://github.com/kuzzleio/sdk-javascript","homepage":"http://docs.kuzzle.io/sdk-reference/?javascript#kuzzle","size":31563,"stargazers_count":11,"watchers_count":11,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":11,"default_branch":"master"}},"base":{"label":"kuzzleio:5.x","ref":"5.x","sha":"ec13b7f4c00554b30525b2ede5a972cde35b3f1a","user":{"login":"kuzzleio","id":12933347,"avatar_url":"https://avatars2.githubusercontent.com/u/12933347?v=3","gravatar_id":"","url":"https://api.github.com/users/kuzzleio","html_url":"https://github.com/kuzzleio","followers_url":"https://api.github.com/users/kuzzleio/followers","following_url":"https://api.github.com/users/kuzzleio/following{/other_user}","gists_url":"https://api.github.com/users/kuzzleio/gists{/gist_id}","starred_url":"https://api.github.com/users/kuzzleio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuzzleio/subscriptions","organizations_url":"https://api.github.com/users/kuzzleio/orgs","repos_url":"https://api.github.com/users/kuzzleio/repos","events_url":"https://api.github.com/users/kuzzleio/events{/privacy}","received_events_url":"https://api.github.com/users/kuzzleio/received_events","type":"Organization","site_admin":false},"repo":{"id":40353752,"name":"sdk-javascript","full_name":"kuzzleio/sdk-javascript","owner":{"login":"kuzzleio","id":12933347,"avatar_url":"https://avatars2.githubusercontent.com/u/12933347?v=3","gravatar_id":"","url":"https://api.github.com/users/kuzzleio","html_url":"https://github.com/kuzzleio","followers_url":"https://api.github.com/users/kuzzleio/followers","following_url":"https://api.github.com/users/kuzzleio/following{/other_user}","gists_url":"https://api.github.com/users/kuzzleio/gists{/gist_id}","starred_url":"https://api.github.com/users/kuzzleio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuzzleio/subscriptions","organizations_url":"https://api.github.com/users/kuzzleio/orgs","repos_url":"https://api.github.com/users/kuzzleio/repos","events_url":"https://api.github.com/users/kuzzleio/events{/privacy}","received_events_url":"https://api.github.com/users/kuzzleio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kuzzleio/sdk-javascript","description":"Official javascript SDK for Kuzzle","fork":false,"url":"https://api.github.com/repos/kuzzleio/sdk-javascript","forks_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/forks","keys_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/teams","hooks_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/hooks","issue_events_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/issues/events{/number}","events_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/events","assignees_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/assignees{/user}","branches_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/branches{/branch}","tags_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/tags","blobs_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/git/refs{/sha}","trees_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/statuses/{sha}","languages_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/languages","stargazers_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/stargazers","contributors_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/contributors","subscribers_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/subscribers","subscription_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/subscription","commits_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/commits{/sha}","git_commits_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/git/commits{/sha}","comments_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/comments{/number}","issue_comment_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/issues/comments{/number}","contents_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/contents/{+path}","compare_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/merges","archive_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/downloads","issues_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/issues{/number}","pulls_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls{/number}","milestones_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/milestones{/number}","notifications_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/labels{/name}","releases_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/releases{/id}","deployments_url":"https://api.github.com/repos/kuzzleio/sdk-javascript/deployments","created_at":"2015-08-07T09:54:38Z","updated_at":"2017-05-24T20:50:32Z","pushed_at":"2017-06-08T10:05:30Z","git_url":"git://github.com/kuzzleio/sdk-javascript.git","ssh_url":"git@github.com:kuzzleio/sdk-javascript.git","clone_url":"https://github.com/kuzzleio/sdk-javascript.git","svn_url":"https://github.com/kuzzleio/sdk-javascript","homepage":"http://docs.kuzzle.io/sdk-reference/?javascript#kuzzle","size":31563,"stargazers_count":11,"watchers_count":11,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls/226"},"html":{"href":"https://github.com/kuzzleio/sdk-javascript/pull/226"},"issue":{"href":"https://api.github.com/repos/kuzzleio/sdk-javascript/issues/226"},"comments":{"href":"https://api.github.com/repos/kuzzleio/sdk-javascript/issues/226/comments"},"review_comments":{"href":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls/226/comments"},"review_comment":{"href":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kuzzleio/sdk-javascript/pulls/226/commits"},"statuses":{"href":"https://api.github.com/repos/kuzzleio/sdk-javascript/statuses/ab465eea2b7061a4029a812cbb46b5154d83ddf2"}}}}
{"actor":{"display_login":"benoitvidis"}}