{"action":"created","comment":{"url":"https://api.github.com/repos/zulip/zulip/pulls/comments/63631059","id":63631059,"diff_hunk":"@@ -2388,16 +2388,22 @@ def gather_subscriptions_helper(user_profile):\n     for stream in stream_dicts:\n         stream_hash[stream[\"id\"]] = stream\n \n+    all_streams = get_all_realm_streams(user_profile.realm).values()\n+    all_streams_id = [stream[\"id\"] for stream in all_streams]\n+\n     subscribed = []\n     unsubscribed = []\n+    never_subscribed = []\n \n     # Deactivated streams aren't in stream_hash.\n     streams = [stream_hash[sub[\"recipient__type_id\"]] for sub in sub_dicts \\\n                    if sub[\"recipient__type_id\"] in stream_hash]\n     streams_subscribed_map = dict((sub[\"recipient__type_id\"], sub[\"active\"]) for sub in sub_dicts)\n     subscriber_map = bulk_get_subscriber_user_ids(streams, user_profile, streams_subscribed_map)\n \n+    sub_unsub_stream_ids = []","path":"zerver/lib/actions.py","position":17,"original_position":17,"commit_id":"f9e7ecd37751c0b37131fbad150b7c539eb27d7f","original_commit_id":"f9e7ecd37751c0b37131fbad150b7c539eb27d7f","user":{"login":"timabbott","id":2746074,"avatar_url":"https://avatars.githubusercontent.com/u/2746074?v=3","gravatar_id":"","url":"https://api.github.com/users/timabbott","html_url":"https://github.com/timabbott","followers_url":"https://api.github.com/users/timabbott/followers","following_url":"https://api.github.com/users/timabbott/following{/other_user}","gists_url":"https://api.github.com/users/timabbott/gists{/gist_id}","starred_url":"https://api.github.com/users/timabbott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timabbott/subscriptions","organizations_url":"https://api.github.com/users/timabbott/orgs","repos_url":"https://api.github.com/users/timabbott/repos","events_url":"https://api.github.com/users/timabbott/events{/privacy}","received_events_url":"https://api.github.com/users/timabbott/received_events","type":"User","site_admin":false},"body":"You should use a `set` data structure here for better performance.","created_at":"2016-05-18T01:06:09Z","updated_at":"2016-05-18T01:06:10Z","html_url":"https://github.com/zulip/zulip/pull/749#discussion_r63631059","pull_request_url":"https://api.github.com/repos/zulip/zulip/pulls/749","_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments/63631059"},"html":{"href":"https://github.com/zulip/zulip/pull/749#discussion_r63631059"},"pull_request":{"href":"https://api.github.com/repos/zulip/zulip/pulls/749"}}},"pull_request":{"url":"https://api.github.com/repos/zulip/zulip/pulls/749","id":68751831,"html_url":"https://github.com/zulip/zulip/pull/749","diff_url":"https://github.com/zulip/zulip/pull/749.diff","patch_url":"https://github.com/zulip/zulip/pull/749.patch","issue_url":"https://api.github.com/repos/zulip/zulip/issues/749","number":749,"state":"open","locked":false,"title":"Narrowing to non existing stream gives error message.","user":{"login":"krtkmj","id":6594924,"avatar_url":"https://avatars.githubusercontent.com/u/6594924?v=3","gravatar_id":"","url":"https://api.github.com/users/krtkmj","html_url":"https://github.com/krtkmj","followers_url":"https://api.github.com/users/krtkmj/followers","following_url":"https://api.github.com/users/krtkmj/following{/other_user}","gists_url":"https://api.github.com/users/krtkmj/gists{/gist_id}","starred_url":"https://api.github.com/users/krtkmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krtkmj/subscriptions","organizations_url":"https://api.github.com/users/krtkmj/orgs","repos_url":"https://api.github.com/users/krtkmj/repos","events_url":"https://api.github.com/users/krtkmj/events{/privacy}","received_events_url":"https://api.github.com/users/krtkmj/received_events","type":"User","site_admin":false},"body":"Solves #740 ","created_at":"2016-05-03T18:25:19Z","updated_at":"2016-05-18T01:06:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba566fbc3ff3cb52c29632a527f369ce6df26aad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zulip/zulip/pulls/749/commits","review_comments_url":"https://api.github.com/repos/zulip/zulip/pulls/749/comments","review_comment_url":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/749/comments","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/f9e7ecd37751c0b37131fbad150b7c539eb27d7f","head":{"label":"krtkmj:non-existing-stream-message","ref":"non-existing-stream-message","sha":"f9e7ecd37751c0b37131fbad150b7c539eb27d7f","user":{"login":"krtkmj","id":6594924,"avatar_url":"https://avatars.githubusercontent.com/u/6594924?v=3","gravatar_id":"","url":"https://api.github.com/users/krtkmj","html_url":"https://github.com/krtkmj","followers_url":"https://api.github.com/users/krtkmj/followers","following_url":"https://api.github.com/users/krtkmj/following{/other_user}","gists_url":"https://api.github.com/users/krtkmj/gists{/gist_id}","starred_url":"https://api.github.com/users/krtkmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krtkmj/subscriptions","organizations_url":"https://api.github.com/users/krtkmj/orgs","repos_url":"https://api.github.com/users/krtkmj/repos","events_url":"https://api.github.com/users/krtkmj/events{/privacy}","received_events_url":"https://api.github.com/users/krtkmj/received_events","type":"User","site_admin":false},"repo":{"id":53250007,"name":"zulip","full_name":"krtkmj/zulip","owner":{"login":"krtkmj","id":6594924,"avatar_url":"https://avatars.githubusercontent.com/u/6594924?v=3","gravatar_id":"","url":"https://api.github.com/users/krtkmj","html_url":"https://github.com/krtkmj","followers_url":"https://api.github.com/users/krtkmj/followers","following_url":"https://api.github.com/users/krtkmj/following{/other_user}","gists_url":"https://api.github.com/users/krtkmj/gists{/gist_id}","starred_url":"https://api.github.com/users/krtkmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krtkmj/subscriptions","organizations_url":"https://api.github.com/users/krtkmj/orgs","repos_url":"https://api.github.com/users/krtkmj/repos","events_url":"https://api.github.com/users/krtkmj/events{/privacy}","received_events_url":"https://api.github.com/users/krtkmj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/krtkmj/zulip","description":"Zulip server - powerful open source group chat","fork":true,"url":"https://api.github.com/repos/krtkmj/zulip","forks_url":"https://api.github.com/repos/krtkmj/zulip/forks","keys_url":"https://api.github.com/repos/krtkmj/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/krtkmj/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/krtkmj/zulip/teams","hooks_url":"https://api.github.com/repos/krtkmj/zulip/hooks","issue_events_url":"https://api.github.com/repos/krtkmj/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/krtkmj/zulip/events","assignees_url":"https://api.github.com/repos/krtkmj/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/krtkmj/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/krtkmj/zulip/tags","blobs_url":"https://api.github.com/repos/krtkmj/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/krtkmj/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/krtkmj/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/krtkmj/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/krtkmj/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/krtkmj/zulip/languages","stargazers_url":"https://api.github.com/repos/krtkmj/zulip/stargazers","contributors_url":"https://api.github.com/repos/krtkmj/zulip/contributors","subscribers_url":"https://api.github.com/repos/krtkmj/zulip/subscribers","subscription_url":"https://api.github.com/repos/krtkmj/zulip/subscription","commits_url":"https://api.github.com/repos/krtkmj/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/krtkmj/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/krtkmj/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/krtkmj/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/krtkmj/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/krtkmj/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/krtkmj/zulip/merges","archive_url":"https://api.github.com/repos/krtkmj/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/krtkmj/zulip/downloads","issues_url":"https://api.github.com/repos/krtkmj/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/krtkmj/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/krtkmj/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/krtkmj/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/krtkmj/zulip/labels{/name}","releases_url":"https://api.github.com/repos/krtkmj/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/krtkmj/zulip/deployments","created_at":"2016-03-06T10:49:22Z","updated_at":"2016-03-06T10:49:26Z","pushed_at":"2016-05-16T17:40:48Z","git_url":"git://github.com/krtkmj/zulip.git","ssh_url":"git@github.com:krtkmj/zulip.git","clone_url":"https://github.com/krtkmj/zulip.git","svn_url":"https://github.com/krtkmj/zulip","homepage":"","size":107958,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"zulip:master","ref":"master","sha":"b38913c8f904b36ff65a46d689f6542c436ea3b0","user":{"login":"zulip","id":4921959,"avatar_url":"https://avatars.githubusercontent.com/u/4921959?v=3","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"repo":{"id":43160685,"name":"zulip","full_name":"zulip/zulip","owner":{"login":"zulip","id":4921959,"avatar_url":"https://avatars.githubusercontent.com/u/4921959?v=3","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zulip/zulip","description":"Zulip server - powerful open source group chat","fork":false,"url":"https://api.github.com/repos/zulip/zulip","forks_url":"https://api.github.com/repos/zulip/zulip/forks","keys_url":"https://api.github.com/repos/zulip/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zulip/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zulip/zulip/teams","hooks_url":"https://api.github.com/repos/zulip/zulip/hooks","issue_events_url":"https://api.github.com/repos/zulip/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/zulip/zulip/events","assignees_url":"https://api.github.com/repos/zulip/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/zulip/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/zulip/zulip/tags","blobs_url":"https://api.github.com/repos/zulip/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zulip/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zulip/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/zulip/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/zulip/zulip/languages","stargazers_url":"https://api.github.com/repos/zulip/zulip/stargazers","contributors_url":"https://api.github.com/repos/zulip/zulip/contributors","subscribers_url":"https://api.github.com/repos/zulip/zulip/subscribers","subscription_url":"https://api.github.com/repos/zulip/zulip/subscription","commits_url":"https://api.github.com/repos/zulip/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/zulip/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/zulip/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/zulip/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/zulip/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/zulip/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zulip/zulip/merges","archive_url":"https://api.github.com/repos/zulip/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zulip/zulip/downloads","issues_url":"https://api.github.com/repos/zulip/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/zulip/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/zulip/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/zulip/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zulip/zulip/labels{/name}","releases_url":"https://api.github.com/repos/zulip/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/zulip/zulip/deployments","created_at":"2015-09-25T16:37:25Z","updated_at":"2016-05-17T09:50:57Z","pushed_at":"2016-05-17T23:57:45Z","git_url":"git://github.com/zulip/zulip.git","ssh_url":"git@github.com:zulip/zulip.git","clone_url":"https://github.com/zulip/zulip.git","svn_url":"https://github.com/zulip/zulip","homepage":"","size":113854,"stargazers_count":3857,"watchers_count":3857,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":546,"mirror_url":null,"open_issues_count":290,"forks":546,"open_issues":290,"watchers":3857,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/749"},"html":{"href":"https://github.com/zulip/zulip/pull/749"},"issue":{"href":"https://api.github.com/repos/zulip/zulip/issues/749"},"comments":{"href":"https://api.github.com/repos/zulip/zulip/issues/749/comments"},"review_comments":{"href":"https://api.github.com/repos/zulip/zulip/pulls/749/comments"},"review_comment":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zulip/zulip/pulls/749/commits"},"statuses":{"href":"https://api.github.com/repos/zulip/zulip/statuses/f9e7ecd37751c0b37131fbad150b7c539eb27d7f"}}}}