{"action":"created","comment":{"url":"https://api.github.com/repos/dionyziz/rupture/pulls/comments/72906678","id":72906678,"diff_hunk":"@@ -78,58 +103,68 @@ socket.on('connection', function(client) {\n             method: 'POST',\n         };\n \n-        var workCompletedRequest = http.request(workCompletedOptions, function(response) {\n-            var responseData = '';\n-            response.on('data', function(chunk) {\n+        const workCompletedRequest = http.request(workCompletedOptions, (response) => {\n+            let responseData = '';\n+            response.on('data', (chunk) => {\n                 responseData += chunk;\n             });\n-            response.on('end', function() {\n+            response.on('end', () => {\n                 try {\n-                    var victory = JSON.parse(responseData).victory;\n+                    const victory = JSON.parse(responseData).victory;\n \n                     winston.info('Got (work-completed) response from backend: ' + responseData);\n \n                     if (victory === false) {\n                         createNewWork();\n                     }\n                 }\n-                catch(e) {\n+                catch (e) {\n                     winston.error('Got invalid (work-completed) response from backend');\n                     doNoWork();\n                 }\n             });\n         });\n-        workCompletedRequest.on('error', function(err) {\n+        workCompletedRequest.on('error', (err) => {\n             winston.error('Caught workCompletedRequest error: ' + err);\n             doNoWork();\n         });\n         workCompletedRequest.write(requestBodyString);\n         workCompletedRequest.end();\n     };\n \n-    client.on('get-work', function() {\n+    client.on('get-work', () => {\n         winston.info('get-work from client ' + client.id);\n         victims.victimId = client.id;\n         createNewWork();\n     });\n \n-    client.on('work-completed', function({work, success, host}) {\n+    client.on('work-completed', (data) => {\n+        let work, success, host;\n+\n+        try {\n+            ({work, success, host} = data);\n+        }\n+        catch (e) {\n+            winston.error('Got invalid work-completed from client');\n+            return;\n+        }\n+\n         winston.info('Client indicates work completed: ', work, success, host);\n \n-        var requestBody = work;\n+        const requestBody = work;\n         requestBody.success = success;\n         reportWorkCompleted(requestBody);\n     });\n-    client.on('disconnect', function() {\n+    client.on('disconnect', () => {\n         winston.info('Client ' + client.id + ' disconnected');\n \n-        for (var i in victims) {\n+        for (let i in victims) {\n             if (victims.i == client.id) {","path":"realtime/index.js","position":189,"original_position":189,"commit_id":"ef053b236f7b85ec5eed24ae11ced90b0f219a46","original_commit_id":"ef053b236f7b85ec5eed24ae11ced90b0f219a46","user":{"login":"dionyziz","id":544572,"avatar_url":"https://avatars.githubusercontent.com/u/544572?v=3","gravatar_id":"","url":"https://api.github.com/users/dionyziz","html_url":"https://github.com/dionyziz","followers_url":"https://api.github.com/users/dionyziz/followers","following_url":"https://api.github.com/users/dionyziz/following{/other_user}","gists_url":"https://api.github.com/users/dionyziz/gists{/gist_id}","starred_url":"https://api.github.com/users/dionyziz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dionyziz/subscriptions","organizations_url":"https://api.github.com/users/dionyziz/orgs","repos_url":"https://api.github.com/users/dionyziz/repos","events_url":"https://api.github.com/users/dionyziz/events{/privacy}","received_events_url":"https://api.github.com/users/dionyziz/received_events","type":"User","site_admin":false},"body":"Will fix in #182","created_at":"2016-07-31T16:12:06Z","updated_at":"2016-07-31T16:12:06Z","html_url":"https://github.com/dionyziz/rupture/pull/179#discussion_r72906678","pull_request_url":"https://api.github.com/repos/dionyziz/rupture/pulls/179","_links":{"self":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/comments/72906678"},"html":{"href":"https://github.com/dionyziz/rupture/pull/179#discussion_r72906678"},"pull_request":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/179"}}},"pull_request":{"url":"https://api.github.com/repos/dionyziz/rupture/pulls/179","id":79484470,"html_url":"https://github.com/dionyziz/rupture/pull/179","diff_url":"https://github.com/dionyziz/rupture/pull/179.diff","patch_url":"https://github.com/dionyziz/rupture/pull/179.patch","issue_url":"https://api.github.com/repos/dionyziz/rupture/issues/179","number":179,"state":"open","locked":false,"title":"Realtime test","user":{"login":"dionyziz","id":544572,"avatar_url":"https://avatars.githubusercontent.com/u/544572?v=3","gravatar_id":"","url":"https://api.github.com/users/dionyziz","html_url":"https://github.com/dionyziz","followers_url":"https://api.github.com/users/dionyziz/followers","following_url":"https://api.github.com/users/dionyziz/following{/other_user}","gists_url":"https://api.github.com/users/dionyziz/gists{/gist_id}","starred_url":"https://api.github.com/users/dionyziz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dionyziz/subscriptions","organizations_url":"https://api.github.com/users/dionyziz/orgs","repos_url":"https://api.github.com/users/dionyziz/repos","events_url":"https://api.github.com/users/dionyziz/events{/privacy}","received_events_url":"https://api.github.com/users/dionyziz/received_events","type":"User","site_admin":false},"body":"This patch adds end-to-end tests for the realtime service.\r\n\r\nI modified the realtime service to support command-line parameters using [commander.js](https://github.com/tj/commander.js).\r\n\r\n[Jasmine](https://jasmine.github.io/2.0/introduction.html) is used to write the end-to-end tests for realtime, similar to how we #176 uses Jasmine for client-side tests. The [spec runner](https://gist.github.com/mauvm/172878a9646095d03fd7) is the same. Similarly, [nvm](https://github.com/creationix/nvm) is required to set up node 6.0 and run the tests without the `--harmony_destructuring` parameter.\r\n\r\nThe end-to-end tests for the realtime service are performed by creating a websocket client using [socket.io-client](https://github.com/socketio/socket.io-client) and performing probing requests on the server. The backend service is mocked using [express](https://expressjs.com/).\r\n\r\n**Development workflow change**\r\n\r\nThis introduces the same development workflow changes as #176.","created_at":"2016-07-31T13:03:18Z","updated_at":"2016-07-31T16:12:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24fc17d8694401f696c55bf1083e1b6b28a3bb9a","assignee":{"login":"dimkarakostas","id":8135971,"avatar_url":"https://avatars.githubusercontent.com/u/8135971?v=3","gravatar_id":"","url":"https://api.github.com/users/dimkarakostas","html_url":"https://github.com/dimkarakostas","followers_url":"https://api.github.com/users/dimkarakostas/followers","following_url":"https://api.github.com/users/dimkarakostas/following{/other_user}","gists_url":"https://api.github.com/users/dimkarakostas/gists{/gist_id}","starred_url":"https://api.github.com/users/dimkarakostas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimkarakostas/subscriptions","organizations_url":"https://api.github.com/users/dimkarakostas/orgs","repos_url":"https://api.github.com/users/dimkarakostas/repos","events_url":"https://api.github.com/users/dimkarakostas/events{/privacy}","received_events_url":"https://api.github.com/users/dimkarakostas/received_events","type":"User","site_admin":false},"assignees":[{"login":"dimkarakostas","id":8135971,"avatar_url":"https://avatars.githubusercontent.com/u/8135971?v=3","gravatar_id":"","url":"https://api.github.com/users/dimkarakostas","html_url":"https://github.com/dimkarakostas","followers_url":"https://api.github.com/users/dimkarakostas/followers","following_url":"https://api.github.com/users/dimkarakostas/following{/other_user}","gists_url":"https://api.github.com/users/dimkarakostas/gists{/gist_id}","starred_url":"https://api.github.com/users/dimkarakostas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimkarakostas/subscriptions","organizations_url":"https://api.github.com/users/dimkarakostas/orgs","repos_url":"https://api.github.com/users/dimkarakostas/repos","events_url":"https://api.github.com/users/dimkarakostas/events{/privacy}","received_events_url":"https://api.github.com/users/dimkarakostas/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dionyziz/rupture/pulls/179/commits","review_comments_url":"https://api.github.com/repos/dionyziz/rupture/pulls/179/comments","review_comment_url":"https://api.github.com/repos/dionyziz/rupture/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dionyziz/rupture/issues/179/comments","statuses_url":"https://api.github.com/repos/dionyziz/rupture/statuses/ef053b236f7b85ec5eed24ae11ced90b0f219a46","head":{"label":"dionyziz:realtime_test","ref":"realtime_test","sha":"ef053b236f7b85ec5eed24ae11ced90b0f219a46","user":{"login":"dionyziz","id":544572,"avatar_url":"https://avatars.githubusercontent.com/u/544572?v=3","gravatar_id":"","url":"https://api.github.com/users/dionyziz","html_url":"https://github.com/dionyziz","followers_url":"https://api.github.com/users/dionyziz/followers","following_url":"https://api.github.com/users/dionyziz/following{/other_user}","gists_url":"https://api.github.com/users/dionyziz/gists{/gist_id}","starred_url":"https://api.github.com/users/dionyziz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dionyziz/subscriptions","organizations_url":"https://api.github.com/users/dionyziz/orgs","repos_url":"https://api.github.com/users/dionyziz/repos","events_url":"https://api.github.com/users/dionyziz/events{/privacy}","received_events_url":"https://api.github.com/users/dionyziz/received_events","type":"User","site_admin":false},"repo":{"id":51319299,"name":"rupture","full_name":"dionyziz/rupture","owner":{"login":"dionyziz","id":544572,"avatar_url":"https://avatars.githubusercontent.com/u/544572?v=3","gravatar_id":"","url":"https://api.github.com/users/dionyziz","html_url":"https://github.com/dionyziz","followers_url":"https://api.github.com/users/dionyziz/followers","following_url":"https://api.github.com/users/dionyziz/following{/other_user}","gists_url":"https://api.github.com/users/dionyziz/gists{/gist_id}","starred_url":"https://api.github.com/users/dionyziz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dionyziz/subscriptions","organizations_url":"https://api.github.com/users/dionyziz/orgs","repos_url":"https://api.github.com/users/dionyziz/repos","events_url":"https://api.github.com/users/dionyziz/events{/privacy}","received_events_url":"https://api.github.com/users/dionyziz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dionyziz/rupture","description":"A framework for BREACH and other compression-based crypto attacks","fork":false,"url":"https://api.github.com/repos/dionyziz/rupture","forks_url":"https://api.github.com/repos/dionyziz/rupture/forks","keys_url":"https://api.github.com/repos/dionyziz/rupture/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dionyziz/rupture/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dionyziz/rupture/teams","hooks_url":"https://api.github.com/repos/dionyziz/rupture/hooks","issue_events_url":"https://api.github.com/repos/dionyziz/rupture/issues/events{/number}","events_url":"https://api.github.com/repos/dionyziz/rupture/events","assignees_url":"https://api.github.com/repos/dionyziz/rupture/assignees{/user}","branches_url":"https://api.github.com/repos/dionyziz/rupture/branches{/branch}","tags_url":"https://api.github.com/repos/dionyziz/rupture/tags","blobs_url":"https://api.github.com/repos/dionyziz/rupture/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dionyziz/rupture/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dionyziz/rupture/git/refs{/sha}","trees_url":"https://api.github.com/repos/dionyziz/rupture/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dionyziz/rupture/statuses/{sha}","languages_url":"https://api.github.com/repos/dionyziz/rupture/languages","stargazers_url":"https://api.github.com/repos/dionyziz/rupture/stargazers","contributors_url":"https://api.github.com/repos/dionyziz/rupture/contributors","subscribers_url":"https://api.github.com/repos/dionyziz/rupture/subscribers","subscription_url":"https://api.github.com/repos/dionyziz/rupture/subscription","commits_url":"https://api.github.com/repos/dionyziz/rupture/commits{/sha}","git_commits_url":"https://api.github.com/repos/dionyziz/rupture/git/commits{/sha}","comments_url":"https://api.github.com/repos/dionyziz/rupture/comments{/number}","issue_comment_url":"https://api.github.com/repos/dionyziz/rupture/issues/comments{/number}","contents_url":"https://api.github.com/repos/dionyziz/rupture/contents/{+path}","compare_url":"https://api.github.com/repos/dionyziz/rupture/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dionyziz/rupture/merges","archive_url":"https://api.github.com/repos/dionyziz/rupture/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dionyziz/rupture/downloads","issues_url":"https://api.github.com/repos/dionyziz/rupture/issues{/number}","pulls_url":"https://api.github.com/repos/dionyziz/rupture/pulls{/number}","milestones_url":"https://api.github.com/repos/dionyziz/rupture/milestones{/number}","notifications_url":"https://api.github.com/repos/dionyziz/rupture/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dionyziz/rupture/labels{/name}","releases_url":"https://api.github.com/repos/dionyziz/rupture/releases{/id}","deployments_url":"https://api.github.com/repos/dionyziz/rupture/deployments","created_at":"2016-02-08T19:01:04Z","updated_at":"2016-07-27T00:13:49Z","pushed_at":"2016-07-31T16:08:50Z","git_url":"git://github.com/dionyziz/rupture.git","ssh_url":"git@github.com:dionyziz/rupture.git","clone_url":"https://github.com/dionyziz/rupture.git","svn_url":"https://github.com/dionyziz/rupture","homepage":null,"size":8940,"stargazers_count":103,"watchers_count":103,"language":"TeX","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":41,"forks":16,"open_issues":41,"watchers":103,"default_branch":"develop"}},"base":{"label":"dionyziz:develop","ref":"develop","sha":"4fe130569ee8c3cea562e89e926d2a50693ba01d","user":{"login":"dionyziz","id":544572,"avatar_url":"https://avatars.githubusercontent.com/u/544572?v=3","gravatar_id":"","url":"https://api.github.com/users/dionyziz","html_url":"https://github.com/dionyziz","followers_url":"https://api.github.com/users/dionyziz/followers","following_url":"https://api.github.com/users/dionyziz/following{/other_user}","gists_url":"https://api.github.com/users/dionyziz/gists{/gist_id}","starred_url":"https://api.github.com/users/dionyziz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dionyziz/subscriptions","organizations_url":"https://api.github.com/users/dionyziz/orgs","repos_url":"https://api.github.com/users/dionyziz/repos","events_url":"https://api.github.com/users/dionyziz/events{/privacy}","received_events_url":"https://api.github.com/users/dionyziz/received_events","type":"User","site_admin":false},"repo":{"id":51319299,"name":"rupture","full_name":"dionyziz/rupture","owner":{"login":"dionyziz","id":544572,"avatar_url":"https://avatars.githubusercontent.com/u/544572?v=3","gravatar_id":"","url":"https://api.github.com/users/dionyziz","html_url":"https://github.com/dionyziz","followers_url":"https://api.github.com/users/dionyziz/followers","following_url":"https://api.github.com/users/dionyziz/following{/other_user}","gists_url":"https://api.github.com/users/dionyziz/gists{/gist_id}","starred_url":"https://api.github.com/users/dionyziz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dionyziz/subscriptions","organizations_url":"https://api.github.com/users/dionyziz/orgs","repos_url":"https://api.github.com/users/dionyziz/repos","events_url":"https://api.github.com/users/dionyziz/events{/privacy}","received_events_url":"https://api.github.com/users/dionyziz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dionyziz/rupture","description":"A framework for BREACH and other compression-based crypto attacks","fork":false,"url":"https://api.github.com/repos/dionyziz/rupture","forks_url":"https://api.github.com/repos/dionyziz/rupture/forks","keys_url":"https://api.github.com/repos/dionyziz/rupture/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dionyziz/rupture/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dionyziz/rupture/teams","hooks_url":"https://api.github.com/repos/dionyziz/rupture/hooks","issue_events_url":"https://api.github.com/repos/dionyziz/rupture/issues/events{/number}","events_url":"https://api.github.com/repos/dionyziz/rupture/events","assignees_url":"https://api.github.com/repos/dionyziz/rupture/assignees{/user}","branches_url":"https://api.github.com/repos/dionyziz/rupture/branches{/branch}","tags_url":"https://api.github.com/repos/dionyziz/rupture/tags","blobs_url":"https://api.github.com/repos/dionyziz/rupture/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dionyziz/rupture/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dionyziz/rupture/git/refs{/sha}","trees_url":"https://api.github.com/repos/dionyziz/rupture/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dionyziz/rupture/statuses/{sha}","languages_url":"https://api.github.com/repos/dionyziz/rupture/languages","stargazers_url":"https://api.github.com/repos/dionyziz/rupture/stargazers","contributors_url":"https://api.github.com/repos/dionyziz/rupture/contributors","subscribers_url":"https://api.github.com/repos/dionyziz/rupture/subscribers","subscription_url":"https://api.github.com/repos/dionyziz/rupture/subscription","commits_url":"https://api.github.com/repos/dionyziz/rupture/commits{/sha}","git_commits_url":"https://api.github.com/repos/dionyziz/rupture/git/commits{/sha}","comments_url":"https://api.github.com/repos/dionyziz/rupture/comments{/number}","issue_comment_url":"https://api.github.com/repos/dionyziz/rupture/issues/comments{/number}","contents_url":"https://api.github.com/repos/dionyziz/rupture/contents/{+path}","compare_url":"https://api.github.com/repos/dionyziz/rupture/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dionyziz/rupture/merges","archive_url":"https://api.github.com/repos/dionyziz/rupture/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dionyziz/rupture/downloads","issues_url":"https://api.github.com/repos/dionyziz/rupture/issues{/number}","pulls_url":"https://api.github.com/repos/dionyziz/rupture/pulls{/number}","milestones_url":"https://api.github.com/repos/dionyziz/rupture/milestones{/number}","notifications_url":"https://api.github.com/repos/dionyziz/rupture/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dionyziz/rupture/labels{/name}","releases_url":"https://api.github.com/repos/dionyziz/rupture/releases{/id}","deployments_url":"https://api.github.com/repos/dionyziz/rupture/deployments","created_at":"2016-02-08T19:01:04Z","updated_at":"2016-07-27T00:13:49Z","pushed_at":"2016-07-31T16:08:50Z","git_url":"git://github.com/dionyziz/rupture.git","ssh_url":"git@github.com:dionyziz/rupture.git","clone_url":"https://github.com/dionyziz/rupture.git","svn_url":"https://github.com/dionyziz/rupture","homepage":null,"size":8940,"stargazers_count":103,"watchers_count":103,"language":"TeX","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":41,"forks":16,"open_issues":41,"watchers":103,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/179"},"html":{"href":"https://github.com/dionyziz/rupture/pull/179"},"issue":{"href":"https://api.github.com/repos/dionyziz/rupture/issues/179"},"comments":{"href":"https://api.github.com/repos/dionyziz/rupture/issues/179/comments"},"review_comments":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/179/comments"},"review_comment":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dionyziz/rupture/pulls/179/commits"},"statuses":{"href":"https://api.github.com/repos/dionyziz/rupture/statuses/ef053b236f7b85ec5eed24ae11ced90b0f219a46"}}}}
{"actor":{"display_login":"dionyziz"}}