{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/95468254","pull_request_review_id":16024052,"id":95468254,"diff_hunk":"@@ -156,7 +164,13 @@ ViewerMessaging.prototype.sendMessage_ = function(sentinel, requestId,\n  * @private\n  */\n ViewerMessaging.prototype.sendResponse_ = function(requestId, payload) {\n-  this.sendMessage_(this.responseSentinel_, requestId, null, payload, false);\n+  var message = {\n+    app: APP,\n+    requestid: requestId,\n+    data: payload,\n+    type: MessageType.RESPONSE,","path":"examples/viewer-integr-messaging.js","position":154,"original_position":154,"commit_id":"991e0df6b4cc9323debcbf648388d1aa5f0514c0","original_commit_id":"991e0df6b4cc9323debcbf648388d1aa5f0514c0","user":{"login":"dvoytenko","id":726049,"avatar_url":"https://avatars.githubusercontent.com/u/726049?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoytenko","html_url":"https://github.com/dvoytenko","followers_url":"https://api.github.com/users/dvoytenko/followers","following_url":"https://api.github.com/users/dvoytenko/following{/other_user}","gists_url":"https://api.github.com/users/dvoytenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoytenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoytenko/subscriptions","organizations_url":"https://api.github.com/users/dvoytenko/orgs","repos_url":"https://api.github.com/users/dvoytenko/repos","events_url":"https://api.github.com/users/dvoytenko/events{/privacy}","received_events_url":"https://api.github.com/users/dvoytenko/received_events","type":"User","site_admin":false},"body":"Viewer folk did ask to add `name: ...` here as well, right?","created_at":"2017-01-10T22:04:30Z","updated_at":"2017-01-10T22:04:30Z","html_url":"https://github.com/ampproject/amphtml/pull/6845#discussion_r95468254","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/6845","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/95468254"},"html":{"href":"https://github.com/ampproject/amphtml/pull/6845#discussion_r95468254"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/6845"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/6845","id":99714219,"html_url":"https://github.com/ampproject/amphtml/pull/6845","diff_url":"https://github.com/ampproject/amphtml/pull/6845.diff","patch_url":"https://github.com/ampproject/amphtml/pull/6845.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/6845","number":6845,"state":"open","locked":false,"title":"amp-viewer-integration handshake updates","user":{"login":"chenshay","id":1397465,"avatar_url":"https://avatars.githubusercontent.com/u/1397465?v=3","gravatar_id":"","url":"https://api.github.com/users/chenshay","html_url":"https://github.com/chenshay","followers_url":"https://api.github.com/users/chenshay/followers","following_url":"https://api.github.com/users/chenshay/following{/other_user}","gists_url":"https://api.github.com/users/chenshay/gists{/gist_id}","starred_url":"https://api.github.com/users/chenshay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenshay/subscriptions","organizations_url":"https://api.github.com/users/chenshay/orgs","repos_url":"https://api.github.com/users/chenshay/repos","events_url":"https://api.github.com/users/chenshay/events{/privacy}","received_events_url":"https://api.github.com/users/chenshay/received_events","type":"User","site_admin":false},"body":"1. use messaging.js in the handshake (in amp-viewer-integration.js) rather than sending post messages\r\n2. change the message.requestId type from string to number\r\n3. set the requestProcessor in a setter, not in the Messaging() constructor\r\n4. set the requestProcessor and messageDeliverer after the handshake is done\r\n5. update viewer.html & viewer-integr-messaging.js to send messages in a format required by the messaging.js file (this is duplicate code. will be replaced soon. this is an intermediate step)\r\n6. remove 'sentinel' ('__ __AMP_HTML__REQUEST') and instead use 'app' ('__ __AMP_HTML __') and 'type' ('q' for request, 's' for response) as 2 separate variables\r\n7. fix tests\r\n8. error logging\r\n9. change 'viewerorigin' to 'origin'\r\n10. change 'amp-handshake-request' to 'channelOpen'","created_at":"2016-12-30T01:08:49Z","updated_at":"2017-01-10T22:04:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9f526346b4028f48a09df7e5cba0e4808fc7302","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/6845/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/6845/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/6845/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/991e0df6b4cc9323debcbf648388d1aa5f0514c0","head":{"label":"chenshay:messaging","ref":"messaging","sha":"991e0df6b4cc9323debcbf648388d1aa5f0514c0","user":{"login":"chenshay","id":1397465,"avatar_url":"https://avatars.githubusercontent.com/u/1397465?v=3","gravatar_id":"","url":"https://api.github.com/users/chenshay","html_url":"https://github.com/chenshay","followers_url":"https://api.github.com/users/chenshay/followers","following_url":"https://api.github.com/users/chenshay/following{/other_user}","gists_url":"https://api.github.com/users/chenshay/gists{/gist_id}","starred_url":"https://api.github.com/users/chenshay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenshay/subscriptions","organizations_url":"https://api.github.com/users/chenshay/orgs","repos_url":"https://api.github.com/users/chenshay/repos","events_url":"https://api.github.com/users/chenshay/events{/privacy}","received_events_url":"https://api.github.com/users/chenshay/received_events","type":"User","site_admin":false},"repo":{"id":72464672,"name":"amphtml","full_name":"chenshay/amphtml","owner":{"login":"chenshay","id":1397465,"avatar_url":"https://avatars.githubusercontent.com/u/1397465?v=3","gravatar_id":"","url":"https://api.github.com/users/chenshay","html_url":"https://github.com/chenshay","followers_url":"https://api.github.com/users/chenshay/followers","following_url":"https://api.github.com/users/chenshay/following{/other_user}","gists_url":"https://api.github.com/users/chenshay/gists{/gist_id}","starred_url":"https://api.github.com/users/chenshay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenshay/subscriptions","organizations_url":"https://api.github.com/users/chenshay/orgs","repos_url":"https://api.github.com/users/chenshay/repos","events_url":"https://api.github.com/users/chenshay/events{/privacy}","received_events_url":"https://api.github.com/users/chenshay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chenshay/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":true,"url":"https://api.github.com/repos/chenshay/amphtml","forks_url":"https://api.github.com/repos/chenshay/amphtml/forks","keys_url":"https://api.github.com/repos/chenshay/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chenshay/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chenshay/amphtml/teams","hooks_url":"https://api.github.com/repos/chenshay/amphtml/hooks","issue_events_url":"https://api.github.com/repos/chenshay/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/chenshay/amphtml/events","assignees_url":"https://api.github.com/repos/chenshay/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/chenshay/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/chenshay/amphtml/tags","blobs_url":"https://api.github.com/repos/chenshay/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chenshay/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chenshay/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/chenshay/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chenshay/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/chenshay/amphtml/languages","stargazers_url":"https://api.github.com/repos/chenshay/amphtml/stargazers","contributors_url":"https://api.github.com/repos/chenshay/amphtml/contributors","subscribers_url":"https://api.github.com/repos/chenshay/amphtml/subscribers","subscription_url":"https://api.github.com/repos/chenshay/amphtml/subscription","commits_url":"https://api.github.com/repos/chenshay/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/chenshay/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/chenshay/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/chenshay/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/chenshay/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/chenshay/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chenshay/amphtml/merges","archive_url":"https://api.github.com/repos/chenshay/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chenshay/amphtml/downloads","issues_url":"https://api.github.com/repos/chenshay/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/chenshay/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/chenshay/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/chenshay/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chenshay/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/chenshay/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/chenshay/amphtml/deployments","created_at":"2016-10-31T18:11:57Z","updated_at":"2016-10-31T18:12:02Z","pushed_at":"2017-01-10T18:11:36Z","git_url":"git://github.com/chenshay/amphtml.git","ssh_url":"git@github.com:chenshay/amphtml.git","clone_url":"https://github.com/chenshay/amphtml.git","svn_url":"https://github.com/chenshay/amphtml","homepage":"https://ampproject.org","size":227001,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"ampproject:master","ref":"master","sha":"fdf2220de702c67090feebbb96d69d47b55960d9","user":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":41766002,"name":"amphtml","full_name":"ampproject/amphtml","owner":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ampproject/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":false,"url":"https://api.github.com/repos/ampproject/amphtml","forks_url":"https://api.github.com/repos/ampproject/amphtml/forks","keys_url":"https://api.github.com/repos/ampproject/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amphtml/teams","hooks_url":"https://api.github.com/repos/ampproject/amphtml/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amphtml/events","assignees_url":"https://api.github.com/repos/ampproject/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amphtml/tags","blobs_url":"https://api.github.com/repos/ampproject/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amphtml/languages","stargazers_url":"https://api.github.com/repos/ampproject/amphtml/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amphtml/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amphtml/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amphtml/subscription","commits_url":"https://api.github.com/repos/ampproject/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amphtml/merges","archive_url":"https://api.github.com/repos/ampproject/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amphtml/downloads","issues_url":"https://api.github.com/repos/ampproject/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/ampproject/amphtml/deployments","created_at":"2015-09-01T22:10:53Z","updated_at":"2017-01-10T17:40:39Z","pushed_at":"2017-01-10T22:00:29Z","git_url":"git://github.com/ampproject/amphtml.git","ssh_url":"git@github.com:ampproject/amphtml.git","clone_url":"https://github.com/ampproject/amphtml.git","svn_url":"https://github.com/ampproject/amphtml","homepage":"https://ampproject.org","size":227096,"stargazers_count":9369,"watchers_count":9369,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1491,"mirror_url":null,"open_issues_count":1095,"forks":1491,"open_issues":1095,"watchers":9369,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/6845"},"html":{"href":"https://github.com/ampproject/amphtml/pull/6845"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/6845"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/6845/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/6845/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/6845/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/991e0df6b4cc9323debcbf648388d1aa5f0514c0"}}}}
{"actor":{"display_login":"dvoytenko"}}