{"action":"created","comment":{"url":"https://api.github.com/repos/Rise-Vision/common-template/pulls/comments/221072615","pull_request_review_id":159635429,"id":221072615,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTA3MjYxNQ==","diff_hunk":"@@ -2,20 +2,65 @@\n \n RisePlayerConfiguration.LocalMessaging = (() => {\n \n-  const DEFAULT_CLIENT_NAME = \"ws-client\";\n+  const DEFAULT_CLIENT_NAME = \"ws-client\",\n+    INITIAL_WEBSOCKET_CONNECTION_TIMEOUT = 20 * 1000;\n \n   let _connected = false,\n     _clientName,\n-    _connectionType; // eslint-disable-line no-unused-vars\n+    _connection,\n+    _connectionType,\n+    _initialWebsocketConnectionTimer = null,\n+    _messageHandlers = [];\n \n-  function _broadcastWebsocketMessage() {\n-    // TODO\n+  function _addWebsocketConnectionHandlers() {\n+    _connection.on( \"open\", () => {\n+      clearTimeout( _initialWebsocketConnectionTimer );\n+\n+      console.log( \"local messaging connected\" );\n+\n+      _connected = true;\n+      _sendConnectionEvent();\n+    });\n+\n+    _connection.on( \"close\", () => {\n+      console.log( \"local messaging connection closed\" );\n+    });\n+\n+    _connection.on( \"end\", () => {\n+      console.log( \"local messaging disconnected\" );\n+\n+      _connected = false;\n+    });\n+\n+    _connection.on( \"error\", ( error ) => {\n+      console.log( \"local messaging error\", error.message );","path":"src/rise-local-messaging.js","position":39,"original_position":39,"commit_id":"4daa5431a4021dd1933b30083c1e3c883e2fcb7a","original_commit_id":"4daa5431a4021dd1933b30083c1e3c883e2fcb7a","user":{"login":"santiagonoguez","id":33162690,"node_id":"MDQ6VXNlcjMzMTYyNjkw","avatar_url":"https://avatars2.githubusercontent.com/u/33162690?v=4","gravatar_id":"","url":"https://api.github.com/users/santiagonoguez","html_url":"https://github.com/santiagonoguez","followers_url":"https://api.github.com/users/santiagonoguez/followers","following_url":"https://api.github.com/users/santiagonoguez/following{/other_user}","gists_url":"https://api.github.com/users/santiagonoguez/gists{/gist_id}","starred_url":"https://api.github.com/users/santiagonoguez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santiagonoguez/subscriptions","organizations_url":"https://api.github.com/users/santiagonoguez/orgs","repos_url":"https://api.github.com/users/santiagonoguez/repos","events_url":"https://api.github.com/users/santiagonoguez/events{/privacy}","received_events_url":"https://api.github.com/users/santiagonoguez/received_events","type":"User","site_admin":false},"body":"I assume these errors doesn't imply a disconnection.","created_at":"2018-09-27T20:50:26Z","updated_at":"2018-09-27T20:56:34Z","html_url":"https://github.com/Rise-Vision/common-template/pull/4#discussion_r221072615","pull_request_url":"https://api.github.com/repos/Rise-Vision/common-template/pulls/4","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Rise-Vision/common-template/pulls/comments/221072615"},"html":{"href":"https://github.com/Rise-Vision/common-template/pull/4#discussion_r221072615"},"pull_request":{"href":"https://api.github.com/repos/Rise-Vision/common-template/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/Rise-Vision/common-template/pulls/4","id":218783461,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4NzgzNDYx","html_url":"https://github.com/Rise-Vision/common-template/pull/4","diff_url":"https://github.com/Rise-Vision/common-template/pull/4.diff","patch_url":"https://github.com/Rise-Vision/common-template/pull/4.patch","issue_url":"https://api.github.com/repos/Rise-Vision/common-template/issues/4","number":4,"state":"open","locked":false,"title":"Implement messaging for “websocket” connection","user":{"login":"stulees","id":7407007,"node_id":"MDQ6VXNlcjc0MDcwMDc=","avatar_url":"https://avatars3.githubusercontent.com/u/7407007?v=4","gravatar_id":"","url":"https://api.github.com/users/stulees","html_url":"https://github.com/stulees","followers_url":"https://api.github.com/users/stulees/followers","following_url":"https://api.github.com/users/stulees/following{/other_user}","gists_url":"https://api.github.com/users/stulees/gists{/gist_id}","starred_url":"https://api.github.com/users/stulees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stulees/subscriptions","organizations_url":"https://api.github.com/users/stulees/orgs","repos_url":"https://api.github.com/users/stulees/repos","events_url":"https://api.github.com/users/stulees/events{/privacy}","received_events_url":"https://api.github.com/users/stulees/received_events","type":"User","site_admin":false},"body":"- Temporarily bypassing the dynamic load/append of the Primus client side library script due to all Rise Players still using Viewer. \r\n- Expecting `serverUrl` provided in `detail` object of `configure()` function when configuring for websocket connection\r\n- Disconnects existing connection already made in Viewer (**Note** This is untested)\r\n- Establishes a websocket connection via Primus and handles all relevant websocket events\r\n- `window` dispatches custom event _rise-local-messaging-connection_ event with `{isConnected: Boolean}` detail upon connection status. Allowing for 20 seconds to establish the connection before sending the event. \r\n- Logic applied for`broadcastMessage()` and `receiveMessages()` for \"websocket\" messaging\r\n","created_at":"2018-09-27T20:44:57Z","updated_at":"2018-09-27T20:56:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f151da5d2961500f9af8d06b71e02238eebd934","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Rise-Vision/common-template/pulls/4/commits","review_comments_url":"https://api.github.com/repos/Rise-Vision/common-template/pulls/4/comments","review_comment_url":"https://api.github.com/repos/Rise-Vision/common-template/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Rise-Vision/common-template/issues/4/comments","statuses_url":"https://api.github.com/repos/Rise-Vision/common-template/statuses/4daa5431a4021dd1933b30083c1e3c883e2fcb7a","head":{"label":"Rise-Vision:chore/lm-websocket","ref":"chore/lm-websocket","sha":"4daa5431a4021dd1933b30083c1e3c883e2fcb7a","user":{"login":"Rise-Vision","id":6840223,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDAyMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/6840223?v=4","gravatar_id":"","url":"https://api.github.com/users/Rise-Vision","html_url":"https://github.com/Rise-Vision","followers_url":"https://api.github.com/users/Rise-Vision/followers","following_url":"https://api.github.com/users/Rise-Vision/following{/other_user}","gists_url":"https://api.github.com/users/Rise-Vision/gists{/gist_id}","starred_url":"https://api.github.com/users/Rise-Vision/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rise-Vision/subscriptions","organizations_url":"https://api.github.com/users/Rise-Vision/orgs","repos_url":"https://api.github.com/users/Rise-Vision/repos","events_url":"https://api.github.com/users/Rise-Vision/events{/privacy}","received_events_url":"https://api.github.com/users/Rise-Vision/received_events","type":"Organization","site_admin":false},"repo":{"id":150109433,"node_id":"MDEwOlJlcG9zaXRvcnkxNTAxMDk0MzM=","name":"common-template","full_name":"Rise-Vision/common-template","private":false,"owner":{"login":"Rise-Vision","id":6840223,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDAyMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/6840223?v=4","gravatar_id":"","url":"https://api.github.com/users/Rise-Vision","html_url":"https://github.com/Rise-Vision","followers_url":"https://api.github.com/users/Rise-Vision/followers","following_url":"https://api.github.com/users/Rise-Vision/following{/other_user}","gists_url":"https://api.github.com/users/Rise-Vision/gists{/gist_id}","starred_url":"https://api.github.com/users/Rise-Vision/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rise-Vision/subscriptions","organizations_url":"https://api.github.com/users/Rise-Vision/orgs","repos_url":"https://api.github.com/users/Rise-Vision/repos","events_url":"https://api.github.com/users/Rise-Vision/events{/privacy}","received_events_url":"https://api.github.com/users/Rise-Vision/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Rise-Vision/common-template","description":"Common scripts for Rise Templates","fork":false,"url":"https://api.github.com/repos/Rise-Vision/common-template","forks_url":"https://api.github.com/repos/Rise-Vision/common-template/forks","keys_url":"https://api.github.com/repos/Rise-Vision/common-template/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Rise-Vision/common-template/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Rise-Vision/common-template/teams","hooks_url":"https://api.github.com/repos/Rise-Vision/common-template/hooks","issue_events_url":"https://api.github.com/repos/Rise-Vision/common-template/issues/events{/number}","events_url":"https://api.github.com/repos/Rise-Vision/common-template/events","assignees_url":"https://api.github.com/repos/Rise-Vision/common-template/assignees{/user}","branches_url":"https://api.github.com/repos/Rise-Vision/common-template/branches{/branch}","tags_url":"https://api.github.com/repos/Rise-Vision/common-template/tags","blobs_url":"https://api.github.com/repos/Rise-Vision/common-template/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Rise-Vision/common-template/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Rise-Vision/common-template/git/refs{/sha}","trees_url":"https://api.github.com/repos/Rise-Vision/common-template/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Rise-Vision/common-template/statuses/{sha}","languages_url":"https://api.github.com/repos/Rise-Vision/common-template/languages","stargazers_url":"https://api.github.com/repos/Rise-Vision/common-template/stargazers","contributors_url":"https://api.github.com/repos/Rise-Vision/common-template/contributors","subscribers_url":"https://api.github.com/repos/Rise-Vision/common-template/subscribers","subscription_url":"https://api.github.com/repos/Rise-Vision/common-template/subscription","commits_url":"https://api.github.com/repos/Rise-Vision/common-template/commits{/sha}","git_commits_url":"https://api.github.com/repos/Rise-Vision/common-template/git/commits{/sha}","comments_url":"https://api.github.com/repos/Rise-Vision/common-template/comments{/number}","issue_comment_url":"https://api.github.com/repos/Rise-Vision/common-template/issues/comments{/number}","contents_url":"https://api.github.com/repos/Rise-Vision/common-template/contents/{+path}","compare_url":"https://api.github.com/repos/Rise-Vision/common-template/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Rise-Vision/common-template/merges","archive_url":"https://api.github.com/repos/Rise-Vision/common-template/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Rise-Vision/common-template/downloads","issues_url":"https://api.github.com/repos/Rise-Vision/common-template/issues{/number}","pulls_url":"https://api.github.com/repos/Rise-Vision/common-template/pulls{/number}","milestones_url":"https://api.github.com/repos/Rise-Vision/common-template/milestones{/number}","notifications_url":"https://api.github.com/repos/Rise-Vision/common-template/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Rise-Vision/common-template/labels{/name}","releases_url":"https://api.github.com/repos/Rise-Vision/common-template/releases{/id}","deployments_url":"https://api.github.com/repos/Rise-Vision/common-template/deployments","created_at":"2018-09-24T13:47:01Z","updated_at":"2018-09-27T17:16:36Z","pushed_at":"2018-09-27T20:44:57Z","git_url":"git://github.com/Rise-Vision/common-template.git","ssh_url":"git@github.com:Rise-Vision/common-template.git","clone_url":"https://github.com/Rise-Vision/common-template.git","svn_url":"https://github.com/Rise-Vision/common-template","homepage":null,"size":272,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Rise-Vision:master","ref":"master","sha":"14b423b20790a2304b62f6aff5a8100bbaad6b54","user":{"login":"Rise-Vision","id":6840223,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDAyMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/6840223?v=4","gravatar_id":"","url":"https://api.github.com/users/Rise-Vision","html_url":"https://github.com/Rise-Vision","followers_url":"https://api.github.com/users/Rise-Vision/followers","following_url":"https://api.github.com/users/Rise-Vision/following{/other_user}","gists_url":"https://api.github.com/users/Rise-Vision/gists{/gist_id}","starred_url":"https://api.github.com/users/Rise-Vision/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rise-Vision/subscriptions","organizations_url":"https://api.github.com/users/Rise-Vision/orgs","repos_url":"https://api.github.com/users/Rise-Vision/repos","events_url":"https://api.github.com/users/Rise-Vision/events{/privacy}","received_events_url":"https://api.github.com/users/Rise-Vision/received_events","type":"Organization","site_admin":false},"repo":{"id":150109433,"node_id":"MDEwOlJlcG9zaXRvcnkxNTAxMDk0MzM=","name":"common-template","full_name":"Rise-Vision/common-template","private":false,"owner":{"login":"Rise-Vision","id":6840223,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDAyMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/6840223?v=4","gravatar_id":"","url":"https://api.github.com/users/Rise-Vision","html_url":"https://github.com/Rise-Vision","followers_url":"https://api.github.com/users/Rise-Vision/followers","following_url":"https://api.github.com/users/Rise-Vision/following{/other_user}","gists_url":"https://api.github.com/users/Rise-Vision/gists{/gist_id}","starred_url":"https://api.github.com/users/Rise-Vision/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rise-Vision/subscriptions","organizations_url":"https://api.github.com/users/Rise-Vision/orgs","repos_url":"https://api.github.com/users/Rise-Vision/repos","events_url":"https://api.github.com/users/Rise-Vision/events{/privacy}","received_events_url":"https://api.github.com/users/Rise-Vision/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Rise-Vision/common-template","description":"Common scripts for Rise Templates","fork":false,"url":"https://api.github.com/repos/Rise-Vision/common-template","forks_url":"https://api.github.com/repos/Rise-Vision/common-template/forks","keys_url":"https://api.github.com/repos/Rise-Vision/common-template/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Rise-Vision/common-template/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Rise-Vision/common-template/teams","hooks_url":"https://api.github.com/repos/Rise-Vision/common-template/hooks","issue_events_url":"https://api.github.com/repos/Rise-Vision/common-template/issues/events{/number}","events_url":"https://api.github.com/repos/Rise-Vision/common-template/events","assignees_url":"https://api.github.com/repos/Rise-Vision/common-template/assignees{/user}","branches_url":"https://api.github.com/repos/Rise-Vision/common-template/branches{/branch}","tags_url":"https://api.github.com/repos/Rise-Vision/common-template/tags","blobs_url":"https://api.github.com/repos/Rise-Vision/common-template/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Rise-Vision/common-template/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Rise-Vision/common-template/git/refs{/sha}","trees_url":"https://api.github.com/repos/Rise-Vision/common-template/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Rise-Vision/common-template/statuses/{sha}","languages_url":"https://api.github.com/repos/Rise-Vision/common-template/languages","stargazers_url":"https://api.github.com/repos/Rise-Vision/common-template/stargazers","contributors_url":"https://api.github.com/repos/Rise-Vision/common-template/contributors","subscribers_url":"https://api.github.com/repos/Rise-Vision/common-template/subscribers","subscription_url":"https://api.github.com/repos/Rise-Vision/common-template/subscription","commits_url":"https://api.github.com/repos/Rise-Vision/common-template/commits{/sha}","git_commits_url":"https://api.github.com/repos/Rise-Vision/common-template/git/commits{/sha}","comments_url":"https://api.github.com/repos/Rise-Vision/common-template/comments{/number}","issue_comment_url":"https://api.github.com/repos/Rise-Vision/common-template/issues/comments{/number}","contents_url":"https://api.github.com/repos/Rise-Vision/common-template/contents/{+path}","compare_url":"https://api.github.com/repos/Rise-Vision/common-template/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Rise-Vision/common-template/merges","archive_url":"https://api.github.com/repos/Rise-Vision/common-template/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Rise-Vision/common-template/downloads","issues_url":"https://api.github.com/repos/Rise-Vision/common-template/issues{/number}","pulls_url":"https://api.github.com/repos/Rise-Vision/common-template/pulls{/number}","milestones_url":"https://api.github.com/repos/Rise-Vision/common-template/milestones{/number}","notifications_url":"https://api.github.com/repos/Rise-Vision/common-template/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Rise-Vision/common-template/labels{/name}","releases_url":"https://api.github.com/repos/Rise-Vision/common-template/releases{/id}","deployments_url":"https://api.github.com/repos/Rise-Vision/common-template/deployments","created_at":"2018-09-24T13:47:01Z","updated_at":"2018-09-27T17:16:36Z","pushed_at":"2018-09-27T20:44:57Z","git_url":"git://github.com/Rise-Vision/common-template.git","ssh_url":"git@github.com:Rise-Vision/common-template.git","clone_url":"https://github.com/Rise-Vision/common-template.git","svn_url":"https://github.com/Rise-Vision/common-template","homepage":null,"size":272,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Rise-Vision/common-template/pulls/4"},"html":{"href":"https://github.com/Rise-Vision/common-template/pull/4"},"issue":{"href":"https://api.github.com/repos/Rise-Vision/common-template/issues/4"},"comments":{"href":"https://api.github.com/repos/Rise-Vision/common-template/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/Rise-Vision/common-template/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/Rise-Vision/common-template/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Rise-Vision/common-template/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/Rise-Vision/common-template/statuses/4daa5431a4021dd1933b30083c1e3c883e2fcb7a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"santiagonoguez"}}