{"action":"created","comment":{"url":"https://api.github.com/repos/wireapp/wire-webapp/pulls/comments/214880222","pull_request_review_id":152023180,"id":214880222,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDg4MDIyMg==","diff_hunk":"@@ -0,0 +1,68 @@\n+/*\n+ * Wire\n+ * Copyright (C) 2018 Wire Swiss GmbH\n+ *\n+ * This program is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License as published by\n+ * the Free Software Foundation, either version 3 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program. If not, see http://www.gnu.org/licenses/.\n+ *\n+ */\n+\n+'use strict';\n+\n+// grunt test_init && grunt test_run:calling/CallMessageBuilder\n+\n+describe('z.calling.CallMessageBuilder', () => {\n+  const callMessageBuilder = z.calling.CallMessageBuilder;\n+\n+  describe('createPropSync', () => {\n+    it('generates prop sync message with the raw stream properties', () => {\n+      const tests = [\n+        {\n+          expected: {audiosend: 'true', screensend: 'false', videosend: 'true'},\n+          props: {audioSend: () => true, screenSend: () => false, videoSend: () => true},\n+        },\n+        {\n+          expected: {audiosend: 'false', screensend: 'false', videosend: 'false'},\n+          props: {audioSend: () => false, screenSend: () => false, videoSend: () => false},\n+        },\n+        {\n+          expected: {audiosend: 'true', screensend: 'true', videosend: 'false'},\n+          props: {audioSend: () => true, screenSend: () => true, videoSend: () => false},\n+        },\n+      ];\n+\n+      tests.forEach(({props, expected}) => {\n+        const propSyncMessage = callMessageBuilder.createPropSync(props);\n+        expect(propSyncMessage.properties).toEqual(expected);\n+      });\n+    });\n+\n+    it('adds extra paypload properties', () => {\n+      const state = {audioSend: () => true, screenSend: () => false, videoSend: () => true};\n+      const extraPayload = {extra: 'hey'};\n+\n+      const propSyncMessage = callMessageBuilder.createPropSync(state, extraPayload);\n+      expect(propSyncMessage).toEqual(jasmine.objectContaining(extraPayload));\n+    });\n+\n+    it('forces video state if given', () => {\n+      const state = {audioSend: () => true, screenSend: () => false, videoSend: () => false};\n+\n+      const propSyncMessageWithVideo = callMessageBuilder.createPropSync(state, {}, true);\n+      expect(propSyncMessageWithVideo.properties.videosend).toEqual('true');\n+\n+      const propSyncMessageWithoutVideo = callMessageBuilder.createPropSync(state, {}, false);\n+      expect(propSyncMessageWithoutVideo.properties.videosend).toEqual('false');","path":"test/unit_tests/calling/CallMessageBuilderSpec.js","position":65,"original_position":65,"commit_id":"ea8fc36b58e4ac2cfe3d87e230da07ec71de4f21","original_commit_id":"ea8fc36b58e4ac2cfe3d87e230da07ec71de4f21","user":{"login":"bennyn","id":469989,"node_id":"MDQ6VXNlcjQ2OTk4OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/469989?v=4","gravatar_id":"","url":"https://api.github.com/users/bennyn","html_url":"https://github.com/bennyn","followers_url":"https://api.github.com/users/bennyn/followers","following_url":"https://api.github.com/users/bennyn/following{/other_user}","gists_url":"https://api.github.com/users/bennyn/gists{/gist_id}","starred_url":"https://api.github.com/users/bennyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bennyn/subscriptions","organizations_url":"https://api.github.com/users/bennyn/orgs","repos_url":"https://api.github.com/users/bennyn/repos","events_url":"https://api.github.com/users/bennyn/events{/privacy}","received_events_url":"https://api.github.com/users/bennyn/received_events","type":"User","site_admin":false},"body":"Would be nice to have a test where `videoSend` is `true` in the beginning and then forced to be `false`.","created_at":"2018-09-04T11:32:37Z","updated_at":"2018-09-04T11:32:37Z","html_url":"https://github.com/wireapp/wire-webapp/pull/4489#discussion_r214880222","pull_request_url":"https://api.github.com/repos/wireapp/wire-webapp/pulls/4489","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/wireapp/wire-webapp/pulls/comments/214880222"},"html":{"href":"https://github.com/wireapp/wire-webapp/pull/4489#discussion_r214880222"},"pull_request":{"href":"https://api.github.com/repos/wireapp/wire-webapp/pulls/4489"}}},"pull_request":{"url":"https://api.github.com/repos/wireapp/wire-webapp/pulls/4489","id":212749776,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyNzQ5Nzc2","html_url":"https://github.com/wireapp/wire-webapp/pull/4489","diff_url":"https://github.com/wireapp/wire-webapp/pull/4489.diff","patch_url":"https://github.com/wireapp/wire-webapp/pull/4489.patch","issue_url":"https://api.github.com/repos/wireapp/wire-webapp/issues/4489","number":4489,"state":"open","locked":false,"title":"fix: Send the complete mediaStream state when syncing props (WEBAPP-5181)","user":{"login":"atomrc","id":1090716,"node_id":"MDQ6VXNlcjEwOTA3MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1090716?v=4","gravatar_id":"","url":"https://api.github.com/users/atomrc","html_url":"https://github.com/atomrc","followers_url":"https://api.github.com/users/atomrc/followers","following_url":"https://api.github.com/users/atomrc/following{/other_user}","gists_url":"https://api.github.com/users/atomrc/gists{/gist_id}","starred_url":"https://api.github.com/users/atomrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atomrc/subscriptions","organizations_url":"https://api.github.com/users/atomrc/orgs","repos_url":"https://api.github.com/users/atomrc/repos","events_url":"https://api.github.com/users/atomrc/events{/privacy}","received_events_url":"https://api.github.com/users/atomrc/received_events","type":"User","site_admin":false},"body":"This is a, somewhat, important change.\r\nBefore, we were trying to be intelligent and just send the updates that were needed.\r\nThe new behavior is that we now send the complete state of the media streams.\r\n\r\nThe problem with the initial solution is that we can easily have inconsistent state (update the `audio` stream but give the wrong type to the method and actually send the `video` property).\r\n\r\nReceiving the full config object (instead of just the updates) should not be a problem on AVS side and it's not a problem on the webapp side because the observables won't trigger if the value hasn't changes (see \"Forcing observables to always notify subscribers\" https://knockoutjs.com/documentation/observables.html)","created_at":"2018-09-03T13:29:49Z","updated_at":"2018-09-04T11:32:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b6cbfb89aa407cfe63416ca768524f2da8d82ae","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wireapp/wire-webapp/pulls/4489/commits","review_comments_url":"https://api.github.com/repos/wireapp/wire-webapp/pulls/4489/comments","review_comment_url":"https://api.github.com/repos/wireapp/wire-webapp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wireapp/wire-webapp/issues/4489/comments","statuses_url":"https://api.github.com/repos/wireapp/wire-webapp/statuses/ea8fc36b58e4ac2cfe3d87e230da07ec71de4f21","head":{"label":"wireapp:fix/screenshare_late_joiner","ref":"fix/screenshare_late_joiner","sha":"ea8fc36b58e4ac2cfe3d87e230da07ec71de4f21","user":{"login":"wireapp","id":16047324,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDQ3MzI0","avatar_url":"https://avatars3.githubusercontent.com/u/16047324?v=4","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"repo":{"id":63881328,"node_id":"MDEwOlJlcG9zaXRvcnk2Mzg4MTMyOA==","name":"wire-webapp","full_name":"wireapp/wire-webapp","owner":{"login":"wireapp","id":16047324,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDQ3MzI0","avatar_url":"https://avatars3.githubusercontent.com/u/16047324?v=4","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wireapp/wire-webapp","description":"👽 Wire for web","fork":false,"url":"https://api.github.com/repos/wireapp/wire-webapp","forks_url":"https://api.github.com/repos/wireapp/wire-webapp/forks","keys_url":"https://api.github.com/repos/wireapp/wire-webapp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wireapp/wire-webapp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wireapp/wire-webapp/teams","hooks_url":"https://api.github.com/repos/wireapp/wire-webapp/hooks","issue_events_url":"https://api.github.com/repos/wireapp/wire-webapp/issues/events{/number}","events_url":"https://api.github.com/repos/wireapp/wire-webapp/events","assignees_url":"https://api.github.com/repos/wireapp/wire-webapp/assignees{/user}","branches_url":"https://api.github.com/repos/wireapp/wire-webapp/branches{/branch}","tags_url":"https://api.github.com/repos/wireapp/wire-webapp/tags","blobs_url":"https://api.github.com/repos/wireapp/wire-webapp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wireapp/wire-webapp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wireapp/wire-webapp/git/refs{/sha}","trees_url":"https://api.github.com/repos/wireapp/wire-webapp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wireapp/wire-webapp/statuses/{sha}","languages_url":"https://api.github.com/repos/wireapp/wire-webapp/languages","stargazers_url":"https://api.github.com/repos/wireapp/wire-webapp/stargazers","contributors_url":"https://api.github.com/repos/wireapp/wire-webapp/contributors","subscribers_url":"https://api.github.com/repos/wireapp/wire-webapp/subscribers","subscription_url":"https://api.github.com/repos/wireapp/wire-webapp/subscription","commits_url":"https://api.github.com/repos/wireapp/wire-webapp/commits{/sha}","git_commits_url":"https://api.github.com/repos/wireapp/wire-webapp/git/commits{/sha}","comments_url":"https://api.github.com/repos/wireapp/wire-webapp/comments{/number}","issue_comment_url":"https://api.github.com/repos/wireapp/wire-webapp/issues/comments{/number}","contents_url":"https://api.github.com/repos/wireapp/wire-webapp/contents/{+path}","compare_url":"https://api.github.com/repos/wireapp/wire-webapp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wireapp/wire-webapp/merges","archive_url":"https://api.github.com/repos/wireapp/wire-webapp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wireapp/wire-webapp/downloads","issues_url":"https://api.github.com/repos/wireapp/wire-webapp/issues{/number}","pulls_url":"https://api.github.com/repos/wireapp/wire-webapp/pulls{/number}","milestones_url":"https://api.github.com/repos/wireapp/wire-webapp/milestones{/number}","notifications_url":"https://api.github.com/repos/wireapp/wire-webapp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wireapp/wire-webapp/labels{/name}","releases_url":"https://api.github.com/repos/wireapp/wire-webapp/releases{/id}","deployments_url":"https://api.github.com/repos/wireapp/wire-webapp/deployments","created_at":"2016-07-21T15:34:05Z","updated_at":"2018-09-04T11:28:51Z","pushed_at":"2018-09-04T11:28:51Z","git_url":"git://github.com/wireapp/wire-webapp.git","ssh_url":"git@github.com:wireapp/wire-webapp.git","clone_url":"https://github.com/wireapp/wire-webapp.git","svn_url":"https://github.com/wireapp/wire-webapp","homepage":"https://app.wire.com","size":26748,"stargazers_count":802,"watchers_count":802,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":176,"mirror_url":null,"archived":false,"open_issues_count":35,"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":176,"open_issues":35,"watchers":802,"default_branch":"dev"}},"base":{"label":"wireapp:dev","ref":"dev","sha":"d833cdd16b9bf0453754159bae51742175ff0269","user":{"login":"wireapp","id":16047324,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDQ3MzI0","avatar_url":"https://avatars3.githubusercontent.com/u/16047324?v=4","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"repo":{"id":63881328,"node_id":"MDEwOlJlcG9zaXRvcnk2Mzg4MTMyOA==","name":"wire-webapp","full_name":"wireapp/wire-webapp","owner":{"login":"wireapp","id":16047324,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDQ3MzI0","avatar_url":"https://avatars3.githubusercontent.com/u/16047324?v=4","gravatar_id":"","url":"https://api.github.com/users/wireapp","html_url":"https://github.com/wireapp","followers_url":"https://api.github.com/users/wireapp/followers","following_url":"https://api.github.com/users/wireapp/following{/other_user}","gists_url":"https://api.github.com/users/wireapp/gists{/gist_id}","starred_url":"https://api.github.com/users/wireapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireapp/subscriptions","organizations_url":"https://api.github.com/users/wireapp/orgs","repos_url":"https://api.github.com/users/wireapp/repos","events_url":"https://api.github.com/users/wireapp/events{/privacy}","received_events_url":"https://api.github.com/users/wireapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wireapp/wire-webapp","description":"👽 Wire for web","fork":false,"url":"https://api.github.com/repos/wireapp/wire-webapp","forks_url":"https://api.github.com/repos/wireapp/wire-webapp/forks","keys_url":"https://api.github.com/repos/wireapp/wire-webapp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wireapp/wire-webapp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wireapp/wire-webapp/teams","hooks_url":"https://api.github.com/repos/wireapp/wire-webapp/hooks","issue_events_url":"https://api.github.com/repos/wireapp/wire-webapp/issues/events{/number}","events_url":"https://api.github.com/repos/wireapp/wire-webapp/events","assignees_url":"https://api.github.com/repos/wireapp/wire-webapp/assignees{/user}","branches_url":"https://api.github.com/repos/wireapp/wire-webapp/branches{/branch}","tags_url":"https://api.github.com/repos/wireapp/wire-webapp/tags","blobs_url":"https://api.github.com/repos/wireapp/wire-webapp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wireapp/wire-webapp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wireapp/wire-webapp/git/refs{/sha}","trees_url":"https://api.github.com/repos/wireapp/wire-webapp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wireapp/wire-webapp/statuses/{sha}","languages_url":"https://api.github.com/repos/wireapp/wire-webapp/languages","stargazers_url":"https://api.github.com/repos/wireapp/wire-webapp/stargazers","contributors_url":"https://api.github.com/repos/wireapp/wire-webapp/contributors","subscribers_url":"https://api.github.com/repos/wireapp/wire-webapp/subscribers","subscription_url":"https://api.github.com/repos/wireapp/wire-webapp/subscription","commits_url":"https://api.github.com/repos/wireapp/wire-webapp/commits{/sha}","git_commits_url":"https://api.github.com/repos/wireapp/wire-webapp/git/commits{/sha}","comments_url":"https://api.github.com/repos/wireapp/wire-webapp/comments{/number}","issue_comment_url":"https://api.github.com/repos/wireapp/wire-webapp/issues/comments{/number}","contents_url":"https://api.github.com/repos/wireapp/wire-webapp/contents/{+path}","compare_url":"https://api.github.com/repos/wireapp/wire-webapp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wireapp/wire-webapp/merges","archive_url":"https://api.github.com/repos/wireapp/wire-webapp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wireapp/wire-webapp/downloads","issues_url":"https://api.github.com/repos/wireapp/wire-webapp/issues{/number}","pulls_url":"https://api.github.com/repos/wireapp/wire-webapp/pulls{/number}","milestones_url":"https://api.github.com/repos/wireapp/wire-webapp/milestones{/number}","notifications_url":"https://api.github.com/repos/wireapp/wire-webapp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wireapp/wire-webapp/labels{/name}","releases_url":"https://api.github.com/repos/wireapp/wire-webapp/releases{/id}","deployments_url":"https://api.github.com/repos/wireapp/wire-webapp/deployments","created_at":"2016-07-21T15:34:05Z","updated_at":"2018-09-04T11:28:51Z","pushed_at":"2018-09-04T11:28:51Z","git_url":"git://github.com/wireapp/wire-webapp.git","ssh_url":"git@github.com:wireapp/wire-webapp.git","clone_url":"https://github.com/wireapp/wire-webapp.git","svn_url":"https://github.com/wireapp/wire-webapp","homepage":"https://app.wire.com","size":26748,"stargazers_count":802,"watchers_count":802,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":176,"mirror_url":null,"archived":false,"open_issues_count":35,"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":176,"open_issues":35,"watchers":802,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/wireapp/wire-webapp/pulls/4489"},"html":{"href":"https://github.com/wireapp/wire-webapp/pull/4489"},"issue":{"href":"https://api.github.com/repos/wireapp/wire-webapp/issues/4489"},"comments":{"href":"https://api.github.com/repos/wireapp/wire-webapp/issues/4489/comments"},"review_comments":{"href":"https://api.github.com/repos/wireapp/wire-webapp/pulls/4489/comments"},"review_comment":{"href":"https://api.github.com/repos/wireapp/wire-webapp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wireapp/wire-webapp/pulls/4489/commits"},"statuses":{"href":"https://api.github.com/repos/wireapp/wire-webapp/statuses/ea8fc36b58e4ac2cfe3d87e230da07ec71de4f21"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bennyn"}}