payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mattermost/mattermost-redux/pulls/comments/363731552","pull_request_review_id":339212938,"id":363731552,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM2MzczMTU1Mg==","diff_hunk":"@@ -67,6 +67,14 @@ function addProfileToSet(state: RelationOneToMany<Team, UserProfile>, action: Ge\n     };\n }\n \n+function removeProfileFromTeams(state: RelationOneToMany<Team, UserProfile>, action: GenericAction) {\n+    const newState = {...state};\n+    Object.keys(state).forEach((key) => {","path":"src/reducers/entities/users.ts","position":6,"original_position":6,"commit_id":"063802deff99ea2fee098bc1c4b5aa1cf400ed9b","original_commit_id":"063802deff99ea2fee098bc1c4b5aa1cf400ed9b","user":{"login":"enahum","id":6757047,"node_id":"MDQ6VXNlcjY3NTcwNDc=","avatar_url":"https://avatars1.githubusercontent.com/u/6757047?v=4","gravatar_id":"","url":"https://api.github.com/users/enahum","html_url":"https://github.com/enahum","followers_url":"https://api.github.com/users/enahum/followers","following_url":"https://api.github.com/users/enahum/following{/other_user}","gists_url":"https://api.github.com/users/enahum/gists{/gist_id}","starred_url":"https://api.github.com/users/enahum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enahum/subscriptions","organizations_url":"https://api.github.com/users/enahum/orgs","repos_url":"https://api.github.com/users/enahum/repos","events_url":"https://api.github.com/users/enahum/events{/privacy}","received_events_url":"https://api.github.com/users/enahum/received_events","type":"User","site_admin":false},"body":"Maybe consider having an additional variable to keep track if anything actually change in the state to avoid returning a new state if nothing was changed.","created_at":"2020-01-07T12:47:08Z","updated_at":"2020-01-07T12:47:19Z","html_url":"https://github.com/mattermost/mattermost-redux/pull/1029#discussion_r363731552","pull_request_url":"https://api.github.com/repos/mattermost/mattermost-redux/pulls/1029","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mattermost/mattermost-redux/pulls/comments/363731552"},"html":{"href":"https://github.com/mattermost/mattermost-redux/pull/1029#discussion_r363731552"},"pull_request":{"href":"https://api.github.com/repos/mattermost/mattermost-redux/pulls/1029"}}},"pull_request":{"url":"https://api.github.com/repos/mattermost/mattermost-redux/pulls/1029","id":358921214,"node_id":"MDExOlB1bGxSZXF1ZXN0MzU4OTIxMjE0","html_url":"https://github.com/mattermost/mattermost-redux/pull/1029","diff_url":"https://github.com/mattermost/mattermost-redux/pull/1029.diff","patch_url":"https://github.com/mattermost/mattermost-redux/pull/1029.patch","issue_url":"https://api.github.com/repos/mattermost/mattermost-redux/issues/1029","number":1029,"state":"open","locked":false,"title":"MM-19976 & MM-19978 - Guest accounts, guest user should not see members that share no channels with them","user":{"login":"reflog","id":109876,"node_id":"MDQ6VXNlcjEwOTg3Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/109876?v=4","gravatar_id":"","url":"https://api.github.com/users/reflog","html_url":"https://github.com/reflog","followers_url":"https://api.github.com/users/reflog/followers","following_url":"https://api.github.com/users/reflog/following{/other_user}","gists_url":"https://api.github.com/users/reflog/gists{/gist_id}","starred_url":"https://api.github.com/users/reflog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reflog/subscriptions","organizations_url":"https://api.github.com/users/reflog/orgs","repos_url":"https://api.github.com/users/reflog/repos","events_url":"https://api.github.com/users/reflog/events{/privacy}","received_events_url":"https://api.github.com/users/reflog/received_events","type":"User","site_admin":false},"body":"#### Summary\r\n\r\nWhen a member leaves/being removed, and is not sharing any channels/teams with the current guest user - the guest user should not see that member or access it's info.\r\nThis PR adds a new event that is fired when this occurs and cleans up the state.\r\n\r\n#### Ticket Link\r\nFixes: https://mattermost.atlassian.net/browse/MM-19978 and https://mattermost.atlassian.net/browse/MM-19976\r\n\r\n**Might need additional work on the mobile side to fix offline sync**","created_at":"2020-01-03T09:18:46Z","updated_at":"2020-01-07T12:47:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"429d309ec904be78e4673d5fd8c50ab3434c66b2","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jespino","id":290303,"node_id":"MDQ6VXNlcjI5MDMwMw==","avatar_url":"https://avatars0.githubusercontent.com/u/290303?v=4","gravatar_id":"","url":"https://api.github.com/users/jespino","html_url":"https://github.com/jespino","followers_url":"https://api.github.com/users/jespino/followers","following_url":"https://api.github.com/users/jespino/following{/other_user}","gists_url":"https://api.github.com/users/jespino/gists{/gist_id}","starred_url":"https://api.github.com/users/jespino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jespino/subscriptions","organizations_url":"https://api.github.com/users/jespino/orgs","repos_url":"https://api.github.com/users/jespino/repos","events_url":"https://api.github.com/users/jespino/events{/privacy}","received_events_url":"https://api.github.com/users/jespino/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":559818635,"node_id":"MDU6TGFiZWw1NTk4MTg2MzU=","url":"https://api.github.com/repos/mattermost/mattermost-redux/labels/2:%20Dev%20Review","name":"2: Dev Review","color":"eb6420","default":false,"description":"Requires review by a core commiter"},{"id":1467156588,"node_id":"MDU6TGFiZWwxNDY3MTU2NTg4","url":"https://api.github.com/repos/mattermost/mattermost-redux/labels/2:%20QA%20Review","name":"2: QA Review","color":"7cdfe2","default":false,"description":""}],"milestone":null,"commits_url":"https://api.github.com/repos/mattermost/mattermost-redux/pulls/1029/commits","review_comments_url":"https://api.github.com/repos/mattermost/mattermost-redux/pulls/1029/comments","review_comment_url":"https://api.github.com/repos/mattermost/mattermost-redux/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattermost/mattermost-redux/issues/1029/comments","statuses_url":"https://api.github.com/repos/mattermost/mattermost-redux/statuses/063802deff99ea2fee098bc1c4b5aa1cf400ed9b","head":{"label":"reflog:MM-19976-MM-19978","ref":"MM-19976-MM-19978","sha":"063802deff99ea2fee098bc1c4b5aa1cf400ed9b","user":{"login":"reflog","id":109876,"node_id":"MDQ6VXNlcjEwOTg3Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/109876?v=4","gravatar_id":"","url":"https://api.github.com/users/reflog","html_url":"https://github.com/reflog","followers_url":"https://api.github.com/users/reflog/followers","following_url":"https://api.github.com/users/reflog/following{/other_user}","gists_url":"https://api.github.com/users/reflog/gists{/gist_id}","starred_url":"https://api.github.com/users/reflog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reflog/subscriptions","organizations_url":"https://api.github.com/users/reflog/orgs","repos_url":"https://api.github.com/users/reflog/repos","events_url":"https://api.github.com/users/reflog/events{/privacy}","received_events_url":"https://api.github.com/users/reflog/received_events","type":"User","site_admin":false},"repo":{"id":185539995,"node_id":"MDEwOlJlcG9zaXRvcnkxODU1Mzk5OTU=","name":"mattermost-redux","full_name":"reflog/mattermost-redux","private":false,"owner":{"login":"reflog","id":109876,"node_id":"MDQ6VXNlcjEwOTg3Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/109876?v=4","gravatar_id":"","url":"https://api.github.com/users/reflog","html_url":"https://github.com/reflog","followers_url":"https://api.github.com/users/reflog/followers","following_url":"https://api.github.com/users/reflog/following{/other_user}","gists_url":"https://api.github.com/users/reflog/gists{/gist_id}","starred_url":"https://api.github.com/users/reflog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reflog/subscriptions","organizations_url":"https://api.github.com/users/reflog/orgs","repos_url":"https://api.github.com/users/reflog/repos","events_url":"https://api.github.com/users/reflog/events{/privacy}","received_events_url":"https://api.github.com/users/reflog/received_events","type":"User","site_admin":false},"html_url":"https://github.com/reflog/mattermost-redux","description":"Redux for Mattermost","fork":true,"url":"https://api.github.com/repos/reflog/mattermost-redux","forks_url":"https://api.github.com/repos/reflog/mattermost-redux/forks","keys_url":"https://api.github.com/repos/reflog/mattermost-redux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reflog/mattermost-redux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reflog/mattermost-redux/teams","hooks_url":"https://api.github.com/repos/reflog/mattermost-redux/hooks","issue_events_url":"https://api.github.com/repos/reflog/mattermost-redux/issues/events{/number}","events_url":"https://api.github.com/repos/reflog/mattermost-redux/events","assignees_url":"https://api.github.com/repos/reflog/mattermost-redux/assignees{/user}","branches_url":"https://api.github.com/repos/reflog/mattermost-redux/branches{/branch}","tags_url":"https://api.github.com/repos/reflog/mattermost-redux/tags","blobs_url":"https://api.github.com/repos/reflog/mattermost-redux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reflog/mattermost-redux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reflog/mattermost-redux/git/refs{/sha}","trees_url":"https://api.github.com/repos/reflog/mattermost-redux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reflog/mattermost-redux/statuses/{sha}","languages_url":"https://api.github.com/repos/reflog/mattermost-redux/languages","stargazers_url":"https://api.github.com/repos/reflog/mattermost-redux/stargazers","contributors_url":"https://api.github.com/repos/reflog/mattermost-redux/contributors","subscribers_url":"https://api.github.com/repos/reflog/mattermost-redux/subscribers","subscription_url":"https://api.github.com/repos/reflog/mattermost-redux/subscription","commits_url":"https://api.github.com/repos/reflog/mattermost-redux/commits{/sha}","git_commits_url":"https://api.github.com/repos/reflog/mattermost-redux/git/commits{/sha}","comments_url":"https://api.github.com/repos/reflog/mattermost-redux/comments{/number}","issue_comment_url":"https://api.github.com/repos/reflog/mattermost-redux/issues/comments{/number}","contents_url":"https://api.github.com/repos/reflog/mattermost-redux/contents/{+path}","compare_url":"https://api.github.com/repos/reflog/mattermost-redux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reflog/mattermost-redux/merges","archive_url":"https://api.github.com/repos/reflog/mattermost-redux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reflog/mattermost-redux/downloads","issues_url":"https://api.github.com/repos/reflog/mattermost-redux/issues{/number}","pulls_url":"https://api.github.com/repos/reflog/mattermost-redux/pulls{/number}","milestones_url":"https://api.github.com/repos/reflog/mattermost-redux/milestones{/number}","notifications_url":"https://api.github.com/repos/reflog/mattermost-redux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reflog/mattermost-redux/labels{/name}","releases_url":"https://api.github.com/repos/reflog/mattermost-redux/releases{/id}","deployments_url":"https://api.github.com/repos/reflog/mattermost-redux/deployments","created_at":"2019-05-08T06:03:44Z","updated_at":"2019-09-23T15:09:29Z","pushed_at":"2020-01-07T12:21:45Z","git_url":"git://github.com/reflog/mattermost-redux.git","ssh_url":"git@github.com:reflog/mattermost-redux.git","clone_url":"https://github.com/reflog/mattermost-redux.git","svn_url":"https://github.com/reflog/mattermost-redux","homepage":null,"size":4658,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mattermost:master","ref":"master","sha":"765dda0683df7c3a55b8d141d7a1a2ad8744754d","user":{"login":"mattermost","id":9828093,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk4MjgwOTM=","avatar_url":"https://avatars1.githubusercontent.com/u/9828093?v=4","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"repo":{"id":84744614,"node_id":"MDEwOlJlcG9zaXRvcnk4NDc0NDYxNA==","name":"mattermost-redux","full_name":"mattermost/mattermost-redux","private":false,"owner":{"login":"mattermost","id":9828093,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk4MjgwOTM=","avatar_url":"https://avatars1.githubusercontent.com/u/9828093?v=4","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mattermost/mattermost-redux","description":"Redux for Mattermost","fork":false,"url":"https://api.github.com/repos/mattermost/mattermost-redux","forks_url":"https://api.github.com/repos/mattermost/mattermost-redux/forks","keys_url":"https://api.github.com/repos/mattermost/mattermost-redux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattermost/mattermost-redux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattermost/mattermost-redux/teams","hooks_url":"https://api.github.com/repos/mattermost/mattermost-redux/hooks","issue_events_url":"https://api.github.com/repos/mattermost/mattermost-redux/issues/events{/number}","events_url":"https://api.github.com/repos/mattermost/mattermost-redux/events","assignees_url":"https://api.github.com/repos/mattermost/mattermost-redux/assignees{/user}","branches_url":"https://api.github.com/repos/mattermost/mattermost-redux/branches{/branch}","tags_url":"https://api.github.com/repos/mattermost/mattermost-redux/tags","blobs_url":"https://api.github.com/repos/mattermost/mattermost-redux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattermost/mattermost-redux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattermost/mattermost-redux/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattermost/mattermost-redux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattermost/mattermost-redux/statuses/{sha}","languages_url":"https://api.github.com/repos/mattermost/mattermost-redux/languages","stargazers_url":"https://api.github.com/repos/mattermost/mattermost-redux/stargazers","contributors_url":"https://api.github.com/repos/mattermost/mattermost-redux/contributors","subscribers_url":"https://api.github.com/repos/mattermost/mattermost-redux/subscribers","subscription_url":"https://api.github.com/repos/mattermost/mattermost-redux/subscription","commits_url":"https://api.github.com/repos/mattermost/mattermost-redux/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattermost/mattermost-redux/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattermost/mattermost-redux/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattermost/mattermost-redux/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattermost/mattermost-redux/contents/{+path}","compare_url":"https://api.github.com/repos/mattermost/mattermost-redux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattermost/mattermost-redux/merges","archive_url":"https://api.github.com/repos/mattermost/mattermost-redux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattermost/mattermost-redux/downloads","issues_url":"https://api.github.com/repos/mattermost/mattermost-redux/issues{/number}","pulls_url":"https://api.github.com/repos/mattermost/mattermost-redux/pulls{/number}","milestones_url":"https://api.github.com/repos/mattermost/mattermost-redux/milestones{/number}","notifications_url":"https://api.github.com/repos/mattermost/mattermost-redux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattermost/mattermost-redux/labels{/name}","releases_url":"https://api.github.com/repos/mattermost/mattermost-redux/releases{/id}","deployments_url":"https://api.github.com/repos/mattermost/mattermost-redux/deployments","created_at":"2017-03-12T17:40:39Z","updated_at":"2020-01-07T12:03:16Z","pushed_at":"2020-01-07T12:21:48Z","git_url":"git://github.com/mattermost/mattermost-redux.git","ssh_url":"git@github.com:mattermost/mattermost-redux.git","clone_url":"https://github.com/mattermost/mattermost-redux.git","svn_url":"https://github.com/mattermost/mattermost-redux","homepage":null,"size":4721,"stargazers_count":154,"watchers_count":154,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":328,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":20,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":328,"open_issues":20,"watchers":154,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattermost/mattermost-redux/pulls/1029"},"html":{"href":"https://github.com/mattermost/mattermost-redux/pull/1029"},"issue":{"href":"https://api.github.com/repos/mattermost/mattermost-redux/issues/1029"},"comments":{"href":"https://api.github.com/repos/mattermost/mattermost-redux/issues/1029/comments"},"review_comments":{"href":"https://api.github.com/repos/mattermost/mattermost-redux/pulls/1029/comments"},"review_comment":{"href":"https://api.github.com/repos/mattermost/mattermost-redux/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattermost/mattermost-redux/pulls/1029/commits"},"statuses":{"href":"https://api.github.com/repos/mattermost/mattermost-redux/statuses/063802deff99ea2fee098bc1c4b5aa1cf400ed9b"}},"author_association":"MEMBER"}}
other: {"actor":{"display_login":"enahum"}}