{"action":"created","comment":{"url":"https://api.github.com/repos/KnowSheet/Web/pulls/comments/23891493","id":23891493,"diff_hunk":"@@ -111,34 +107,25 @@ function init() {\n \t\t\t}\n \t\t\t\n \t\t\tpersistentConnection.on('connected', function (data) {\n-\t\t\t\tchunkParser.reset();\n \t\t\t\tjsonPerLineParser.reset();\n \t\t\t});\n \t\t\tpersistentConnection.on('data', function (data) {\n-\t\t\t\tchunkParser.write(data);\n+\t\t\t\tjsonPerLineParser.write(data);\n \t\t\t});\n \t\t\tpersistentConnection.on('end', reconnectOnError);\n \t\t\tpersistentConnection.on('error', reconnectOnError);\n \t\t\t\n-\t\t\tchunkParser.on('data', function (data) {\n-\t\t\t\tjsonPerLineParser.write(data);\n-\t\t\t});\n-\t\t\tchunkParser.on('end', reconnectOnError);\n-\t\t\tchunkParser.on('error', reconnectOnError);\n-\t\t\t\n \t\t\tjsonPerLineParser.on('data', function (data) {\n-\t\t\t\tdata = (data && data.value0 && data.value0.data);\n-\t\t\t\t\n-\t\t\t\tif (data && data.length > 0) {\n+\t\t\t\tif (data && typeof data.x === 'number' && typeof data.y === 'number') {\n \t\t\t\t\t// Advance the time that will go in the next request\n \t\t\t\t\t// to the latest data sample time (add 1 to avoid duplicates):\n-\t\t\t\t\tqueryParams.since = data[data.length-1].x + 1;\n+\t\t\t\t\tqueryParams.since = data.x + 1;\n \t\t\t\t\tpersistentConnection.setQuery(queryParams);\n \t\t\t\t\t\n \t\t\t\t\t// Notify that the data has been received:\n \t\t\t\t\tdispatcher.emit('receive-data', {\n \t\t\t\t\t\tdataUrl: dataUrl,\n-\t\t\t\t\t\tdata: data\n+\t\t\t\t\t\tdata: [ data ]","path":"src/frontend/index.js","position":64,"original_position":64,"commit_id":"d8f90462f7b0358100e26f569ed082a7d390a08b","original_commit_id":"d8f90462f7b0358100e26f569ed082a7d390a08b","user":{"login":"sompylasar","id":498274,"avatar_url":"https://avatars.githubusercontent.com/u/498274?v=3","gravatar_id":"","url":"https://api.github.com/users/sompylasar","html_url":"https://github.com/sompylasar","followers_url":"https://api.github.com/users/sompylasar/followers","following_url":"https://api.github.com/users/sompylasar/following{/other_user}","gists_url":"https://api.github.com/users/sompylasar/gists{/gist_id}","starred_url":"https://api.github.com/users/sompylasar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sompylasar/subscriptions","organizations_url":"https://api.github.com/users/sompylasar/orgs","repos_url":"https://api.github.com/users/sompylasar/repos","events_url":"https://api.github.com/users/sompylasar/events{/privacy}","received_events_url":"https://api.github.com/users/sompylasar/received_events","type":"User","site_admin":false},"body":"I've implemented receiving data as multiple points to be able to push them in batches if needed. It's been used this way before the rewrite to the C++ backend which pushes only the points, one per chunk, not some data with an array of points inside. This is not related to caching at this level, it's batch send/receive.","created_at":"2015-01-31T19:49:16Z","updated_at":"2015-01-31T19:49:16Z","html_url":"https://github.com/KnowSheet/Web/pull/5#discussion_r23891493","pull_request_url":"https://api.github.com/repos/KnowSheet/Web/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/KnowSheet/Web/pulls/comments/23891493"},"html":{"href":"https://github.com/KnowSheet/Web/pull/5#discussion_r23891493"},"pull_request":{"href":"https://api.github.com/repos/KnowSheet/Web/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/KnowSheet/Web/pulls/5","id":28249627,"html_url":"https://github.com/KnowSheet/Web/pull/5","diff_url":"https://github.com/KnowSheet/Web/pull/5.diff","patch_url":"https://github.com/KnowSheet/Web/pull/5.patch","issue_url":"https://api.github.com/repos/KnowSheet/Web/issues/5","number":5,"state":"open","locked":false,"title":"Bugfixes and chunked_demo integration","user":{"login":"sompylasar","id":498274,"avatar_url":"https://avatars.githubusercontent.com/u/498274?v=3","gravatar_id":"","url":"https://api.github.com/users/sompylasar","html_url":"https://github.com/sompylasar","followers_url":"https://api.github.com/users/sompylasar/followers","following_url":"https://api.github.com/users/sompylasar/following{/other_user}","gists_url":"https://api.github.com/users/sompylasar/gists{/gist_id}","starred_url":"https://api.github.com/users/sompylasar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sompylasar/subscriptions","organizations_url":"https://api.github.com/users/sompylasar/orgs","repos_url":"https://api.github.com/users/sompylasar/repos","events_url":"https://api.github.com/users/sompylasar/events{/privacy}","received_events_url":"https://api.github.com/users/sompylasar/received_events","type":"User","site_admin":false},"body":"* Fixed writing chunked data CRLF (it got replaced with just LF\r\nsomewhere internally). This resulted in the browser understanding the\r\nchunked stream and decoding it, so the `chunk-parser` has become\r\nuseless.\r\n* Changed response root object names from \"value0\" to \"layout\" and\r\n\"meta\".\r\n* Changed sending data samples to one data sample per send (this is how\r\nthe data is sent from the `chunked_demo`).\r\n* Commented out data logging (performance drops).","created_at":"2015-01-29T02:44:18Z","updated_at":"2015-01-31T19:49:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62b4df798c14473f321355e042aed4c2e600fc4f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/KnowSheet/Web/pulls/5/commits","review_comments_url":"https://api.github.com/repos/KnowSheet/Web/pulls/5/comments","review_comment_url":"https://api.github.com/repos/KnowSheet/Web/pulls/comments/{number}","comments_url":"https://api.github.com/repos/KnowSheet/Web/issues/5/comments","statuses_url":"https://api.github.com/repos/KnowSheet/Web/statuses/d8f90462f7b0358100e26f569ed082a7d390a08b","head":{"label":"sompylasar:integrate-chunked-demo-with-frontend","ref":"integrate-chunked-demo-with-frontend","sha":"d8f90462f7b0358100e26f569ed082a7d390a08b","user":{"login":"sompylasar","id":498274,"avatar_url":"https://avatars.githubusercontent.com/u/498274?v=3","gravatar_id":"","url":"https://api.github.com/users/sompylasar","html_url":"https://github.com/sompylasar","followers_url":"https://api.github.com/users/sompylasar/followers","following_url":"https://api.github.com/users/sompylasar/following{/other_user}","gists_url":"https://api.github.com/users/sompylasar/gists{/gist_id}","starred_url":"https://api.github.com/users/sompylasar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sompylasar/subscriptions","organizations_url":"https://api.github.com/users/sompylasar/orgs","repos_url":"https://api.github.com/users/sompylasar/repos","events_url":"https://api.github.com/users/sompylasar/events{/privacy}","received_events_url":"https://api.github.com/users/sompylasar/received_events","type":"User","site_admin":false},"repo":{"id":27982752,"name":"Web","full_name":"sompylasar/Web","owner":{"login":"sompylasar","id":498274,"avatar_url":"https://avatars.githubusercontent.com/u/498274?v=3","gravatar_id":"","url":"https://api.github.com/users/sompylasar","html_url":"https://github.com/sompylasar","followers_url":"https://api.github.com/users/sompylasar/followers","following_url":"https://api.github.com/users/sompylasar/following{/other_user}","gists_url":"https://api.github.com/users/sompylasar/gists{/gist_id}","starred_url":"https://api.github.com/users/sompylasar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sompylasar/subscriptions","organizations_url":"https://api.github.com/users/sompylasar/orgs","repos_url":"https://api.github.com/users/sompylasar/repos","events_url":"https://api.github.com/users/sompylasar/events{/privacy}","received_events_url":"https://api.github.com/users/sompylasar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sompylasar/Web","description":"Browser-side code.","fork":true,"url":"https://api.github.com/repos/sompylasar/Web","forks_url":"https://api.github.com/repos/sompylasar/Web/forks","keys_url":"https://api.github.com/repos/sompylasar/Web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sompylasar/Web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sompylasar/Web/teams","hooks_url":"https://api.github.com/repos/sompylasar/Web/hooks","issue_events_url":"https://api.github.com/repos/sompylasar/Web/issues/events{/number}","events_url":"https://api.github.com/repos/sompylasar/Web/events","assignees_url":"https://api.github.com/repos/sompylasar/Web/assignees{/user}","branches_url":"https://api.github.com/repos/sompylasar/Web/branches{/branch}","tags_url":"https://api.github.com/repos/sompylasar/Web/tags","blobs_url":"https://api.github.com/repos/sompylasar/Web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sompylasar/Web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sompylasar/Web/git/refs{/sha}","trees_url":"https://api.github.com/repos/sompylasar/Web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sompylasar/Web/statuses/{sha}","languages_url":"https://api.github.com/repos/sompylasar/Web/languages","stargazers_url":"https://api.github.com/repos/sompylasar/Web/stargazers","contributors_url":"https://api.github.com/repos/sompylasar/Web/contributors","subscribers_url":"https://api.github.com/repos/sompylasar/Web/subscribers","subscription_url":"https://api.github.com/repos/sompylasar/Web/subscription","commits_url":"https://api.github.com/repos/sompylasar/Web/commits{/sha}","git_commits_url":"https://api.github.com/repos/sompylasar/Web/git/commits{/sha}","comments_url":"https://api.github.com/repos/sompylasar/Web/comments{/number}","issue_comment_url":"https://api.github.com/repos/sompylasar/Web/issues/comments/{number}","contents_url":"https://api.github.com/repos/sompylasar/Web/contents/{+path}","compare_url":"https://api.github.com/repos/sompylasar/Web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sompylasar/Web/merges","archive_url":"https://api.github.com/repos/sompylasar/Web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sompylasar/Web/downloads","issues_url":"https://api.github.com/repos/sompylasar/Web/issues{/number}","pulls_url":"https://api.github.com/repos/sompylasar/Web/pulls{/number}","milestones_url":"https://api.github.com/repos/sompylasar/Web/milestones{/number}","notifications_url":"https://api.github.com/repos/sompylasar/Web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sompylasar/Web/labels{/name}","releases_url":"https://api.github.com/repos/sompylasar/Web/releases{/id}","created_at":"2014-12-14T04:03:21Z","updated_at":"2015-01-29T02:27:38Z","pushed_at":"2015-01-29T02:42:37Z","git_url":"git://github.com/sompylasar/Web.git","ssh_url":"git@github.com:sompylasar/Web.git","clone_url":"https://github.com/sompylasar/Web.git","svn_url":"https://github.com/sompylasar/Web","homepage":null,"size":259,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"KnowSheet:master","ref":"master","sha":"74d98650947371984ae348e73d5b1d91acfdfe47","user":{"login":"KnowSheet","id":9897562,"avatar_url":"https://avatars.githubusercontent.com/u/9897562?v=3","gravatar_id":"","url":"https://api.github.com/users/KnowSheet","html_url":"https://github.com/KnowSheet","followers_url":"https://api.github.com/users/KnowSheet/followers","following_url":"https://api.github.com/users/KnowSheet/following{/other_user}","gists_url":"https://api.github.com/users/KnowSheet/gists{/gist_id}","starred_url":"https://api.github.com/users/KnowSheet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KnowSheet/subscriptions","organizations_url":"https://api.github.com/users/KnowSheet/orgs","repos_url":"https://api.github.com/users/KnowSheet/repos","events_url":"https://api.github.com/users/KnowSheet/events{/privacy}","received_events_url":"https://api.github.com/users/KnowSheet/received_events","type":"Organization","site_admin":false},"repo":{"id":27705919,"name":"Web","full_name":"KnowSheet/Web","owner":{"login":"KnowSheet","id":9897562,"avatar_url":"https://avatars.githubusercontent.com/u/9897562?v=3","gravatar_id":"","url":"https://api.github.com/users/KnowSheet","html_url":"https://github.com/KnowSheet","followers_url":"https://api.github.com/users/KnowSheet/followers","following_url":"https://api.github.com/users/KnowSheet/following{/other_user}","gists_url":"https://api.github.com/users/KnowSheet/gists{/gist_id}","starred_url":"https://api.github.com/users/KnowSheet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KnowSheet/subscriptions","organizations_url":"https://api.github.com/users/KnowSheet/orgs","repos_url":"https://api.github.com/users/KnowSheet/repos","events_url":"https://api.github.com/users/KnowSheet/events{/privacy}","received_events_url":"https://api.github.com/users/KnowSheet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KnowSheet/Web","description":"Browser-side code.","fork":false,"url":"https://api.github.com/repos/KnowSheet/Web","forks_url":"https://api.github.com/repos/KnowSheet/Web/forks","keys_url":"https://api.github.com/repos/KnowSheet/Web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KnowSheet/Web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KnowSheet/Web/teams","hooks_url":"https://api.github.com/repos/KnowSheet/Web/hooks","issue_events_url":"https://api.github.com/repos/KnowSheet/Web/issues/events{/number}","events_url":"https://api.github.com/repos/KnowSheet/Web/events","assignees_url":"https://api.github.com/repos/KnowSheet/Web/assignees{/user}","branches_url":"https://api.github.com/repos/KnowSheet/Web/branches{/branch}","tags_url":"https://api.github.com/repos/KnowSheet/Web/tags","blobs_url":"https://api.github.com/repos/KnowSheet/Web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KnowSheet/Web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KnowSheet/Web/git/refs{/sha}","trees_url":"https://api.github.com/repos/KnowSheet/Web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KnowSheet/Web/statuses/{sha}","languages_url":"https://api.github.com/repos/KnowSheet/Web/languages","stargazers_url":"https://api.github.com/repos/KnowSheet/Web/stargazers","contributors_url":"https://api.github.com/repos/KnowSheet/Web/contributors","subscribers_url":"https://api.github.com/repos/KnowSheet/Web/subscribers","subscription_url":"https://api.github.com/repos/KnowSheet/Web/subscription","commits_url":"https://api.github.com/repos/KnowSheet/Web/commits{/sha}","git_commits_url":"https://api.github.com/repos/KnowSheet/Web/git/commits{/sha}","comments_url":"https://api.github.com/repos/KnowSheet/Web/comments{/number}","issue_comment_url":"https://api.github.com/repos/KnowSheet/Web/issues/comments/{number}","contents_url":"https://api.github.com/repos/KnowSheet/Web/contents/{+path}","compare_url":"https://api.github.com/repos/KnowSheet/Web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KnowSheet/Web/merges","archive_url":"https://api.github.com/repos/KnowSheet/Web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KnowSheet/Web/downloads","issues_url":"https://api.github.com/repos/KnowSheet/Web/issues{/number}","pulls_url":"https://api.github.com/repos/KnowSheet/Web/pulls{/number}","milestones_url":"https://api.github.com/repos/KnowSheet/Web/milestones{/number}","notifications_url":"https://api.github.com/repos/KnowSheet/Web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KnowSheet/Web/labels{/name}","releases_url":"https://api.github.com/repos/KnowSheet/Web/releases{/id}","created_at":"2014-12-08T08:49:14Z","updated_at":"2015-01-22T15:57:24Z","pushed_at":"2015-01-22T15:57:24Z","git_url":"git://github.com/KnowSheet/Web.git","ssh_url":"git@github.com:KnowSheet/Web.git","clone_url":"https://github.com/KnowSheet/Web.git","svn_url":"https://github.com/KnowSheet/Web","homepage":null,"size":284,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KnowSheet/Web/pulls/5"},"html":{"href":"https://github.com/KnowSheet/Web/pull/5"},"issue":{"href":"https://api.github.com/repos/KnowSheet/Web/issues/5"},"comments":{"href":"https://api.github.com/repos/KnowSheet/Web/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/KnowSheet/Web/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/KnowSheet/Web/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/KnowSheet/Web/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/KnowSheet/Web/statuses/d8f90462f7b0358100e26f569ed082a7d390a08b"}}}}