{"action":"created","comment":{"url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls/comments/171124206","pull_request_review_id":99922091,"id":171124206,"diff_hunk":"@@ -107,26 +107,16 @@ export class SubscriptionHandshakeLink extends ApolloLink {\n         return new Promise((resolve, reject) => {\n             if (!client.isConnected()) {\n                 const topics = this.clientTopics.get(client).filter(t => t !== topic);\n-                if (topics.length > 0) {\n-                  this.clientTopics.set(client, topics);\n-                } else {\n-                  this.clientTopics.delete(client);\n-                }\n+                this.clientTopics.set(client, topics);","path":"packages/aws-appsync/src/link/subscription-handshake-link.js","position":18,"original_position":18,"commit_id":"f670d063738c0cd1a4c63bfc151b6f5e8480170e","original_commit_id":"f670d063738c0cd1a4c63bfc151b6f5e8480170e","user":{"login":"elorzafe","id":28815678,"avatar_url":"https://avatars2.githubusercontent.com/u/28815678?v=4","gravatar_id":"","url":"https://api.github.com/users/elorzafe","html_url":"https://github.com/elorzafe","followers_url":"https://api.github.com/users/elorzafe/followers","following_url":"https://api.github.com/users/elorzafe/following{/other_user}","gists_url":"https://api.github.com/users/elorzafe/gists{/gist_id}","starred_url":"https://api.github.com/users/elorzafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elorzafe/subscriptions","organizations_url":"https://api.github.com/users/elorzafe/orgs","repos_url":"https://api.github.com/users/elorzafe/repos","events_url":"https://api.github.com/users/elorzafe/events{/privacy}","received_events_url":"https://api.github.com/users/elorzafe/received_events","type":"User","site_admin":false},"body":"Pending: review what happen if client expires","created_at":"2018-02-28T01:52:30Z","updated_at":"2018-02-28T01:53:28Z","html_url":"https://github.com/awslabs/aws-mobile-appsync-sdk-js/pull/60#discussion_r171124206","pull_request_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls/60","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls/comments/171124206"},"html":{"href":"https://github.com/awslabs/aws-mobile-appsync-sdk-js/pull/60#discussion_r171124206"},"pull_request":{"href":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls/60","id":171584232,"html_url":"https://github.com/awslabs/aws-mobile-appsync-sdk-js/pull/60","diff_url":"https://github.com/awslabs/aws-mobile-appsync-sdk-js/pull/60.diff","patch_url":"https://github.com/awslabs/aws-mobile-appsync-sdk-js/pull/60.patch","issue_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/issues/60","number":60,"state":"open","locked":false,"title":"Delete observer associated with a topic when cleanup function is called","user":{"login":"onlybakam","id":554722,"avatar_url":"https://avatars3.githubusercontent.com/u/554722?v=4","gravatar_id":"","url":"https://api.github.com/users/onlybakam","html_url":"https://github.com/onlybakam","followers_url":"https://api.github.com/users/onlybakam/followers","following_url":"https://api.github.com/users/onlybakam/following{/other_user}","gists_url":"https://api.github.com/users/onlybakam/gists{/gist_id}","starred_url":"https://api.github.com/users/onlybakam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onlybakam/subscriptions","organizations_url":"https://api.github.com/users/onlybakam/orgs","repos_url":"https://api.github.com/users/onlybakam/repos","events_url":"https://api.github.com/users/onlybakam/events{/privacy}","received_events_url":"https://api.github.com/users/onlybakam/received_events","type":"User","site_admin":false},"body":"Multiple topics can be associated with a client. This happens when\r\nmultiple subscriptions are live on a single API. In that case,\r\nclientTopics holds client => [topics]. When the cleanup function is\r\ncalled, we should look for a topic within an existing list of topics\r\nassociated with the client to identify it. Doing this allows us to find\r\nthe correct <topic, client> pair which allows us to unsubsribe the\r\nclient from the topic and remove the observer tied to the topic. Leaving\r\na \"completed\" observer in `topicObserver` will lead to it being reused\r\nif we cancel a subscription and then switch back to it. However since\r\nthe observer has been \"completed\", its `next` function would never be\r\ncalled.\r\n\r\nIn `unsubscribeFromTopic` function, we should not delete a `client` key if the\r\nlist of subscribed topics is empty: the client has not been disconnected\r\nyet. The client will be disconnected when `disconnectAll` is called the\r\nnext time `request` is invoked (next subscription setup).","created_at":"2018-02-27T07:36:18Z","updated_at":"2018-02-28T01:53:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ddb3383e44578502828aab37bcb9a7cf88ea83c8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls/60/commits","review_comments_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls/60/comments","review_comment_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/issues/60/comments","statuses_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/statuses/f670d063738c0cd1a4c63bfc151b6f5e8480170e","head":{"label":"onlybakam:revisit-cleanup-function","ref":"revisit-cleanup-function","sha":"f670d063738c0cd1a4c63bfc151b6f5e8480170e","user":{"login":"onlybakam","id":554722,"avatar_url":"https://avatars3.githubusercontent.com/u/554722?v=4","gravatar_id":"","url":"https://api.github.com/users/onlybakam","html_url":"https://github.com/onlybakam","followers_url":"https://api.github.com/users/onlybakam/followers","following_url":"https://api.github.com/users/onlybakam/following{/other_user}","gists_url":"https://api.github.com/users/onlybakam/gists{/gist_id}","starred_url":"https://api.github.com/users/onlybakam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onlybakam/subscriptions","organizations_url":"https://api.github.com/users/onlybakam/orgs","repos_url":"https://api.github.com/users/onlybakam/repos","events_url":"https://api.github.com/users/onlybakam/events{/privacy}","received_events_url":"https://api.github.com/users/onlybakam/received_events","type":"User","site_admin":false},"repo":{"id":120711802,"name":"aws-mobile-appsync-sdk-js","full_name":"onlybakam/aws-mobile-appsync-sdk-js","owner":{"login":"onlybakam","id":554722,"avatar_url":"https://avatars3.githubusercontent.com/u/554722?v=4","gravatar_id":"","url":"https://api.github.com/users/onlybakam","html_url":"https://github.com/onlybakam","followers_url":"https://api.github.com/users/onlybakam/followers","following_url":"https://api.github.com/users/onlybakam/following{/other_user}","gists_url":"https://api.github.com/users/onlybakam/gists{/gist_id}","starred_url":"https://api.github.com/users/onlybakam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onlybakam/subscriptions","organizations_url":"https://api.github.com/users/onlybakam/orgs","repos_url":"https://api.github.com/users/onlybakam/repos","events_url":"https://api.github.com/users/onlybakam/events{/privacy}","received_events_url":"https://api.github.com/users/onlybakam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/onlybakam/aws-mobile-appsync-sdk-js","description":"JavaScript library files for Offline, Sync, Sigv4. includes support for React Native","fork":true,"url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js","forks_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/forks","keys_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/teams","hooks_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/hooks","issue_events_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/issues/events{/number}","events_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/events","assignees_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/assignees{/user}","branches_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/branches{/branch}","tags_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/tags","blobs_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/statuses/{sha}","languages_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/languages","stargazers_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/stargazers","contributors_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/contributors","subscribers_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/subscribers","subscription_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/subscription","commits_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/contents/{+path}","compare_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/merges","archive_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/downloads","issues_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/issues{/number}","pulls_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/pulls{/number}","milestones_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/milestones{/number}","notifications_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/labels{/name}","releases_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/releases{/id}","deployments_url":"https://api.github.com/repos/onlybakam/aws-mobile-appsync-sdk-js/deployments","created_at":"2018-02-08T04:41:39Z","updated_at":"2018-02-08T04:41:40Z","pushed_at":"2018-02-27T07:33:47Z","git_url":"git://github.com/onlybakam/aws-mobile-appsync-sdk-js.git","ssh_url":"git@github.com:onlybakam/aws-mobile-appsync-sdk-js.git","clone_url":"https://github.com/onlybakam/aws-mobile-appsync-sdk-js.git","svn_url":"https://github.com/onlybakam/aws-mobile-appsync-sdk-js","homepage":null,"size":122,"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,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"awslabs:master","ref":"master","sha":"d26ea1ca1a8253df11dea8f11c1749e7bad8ef05","user":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars0.githubusercontent.com/u/3299148?v=4","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"repo":{"id":108162421,"name":"aws-mobile-appsync-sdk-js","full_name":"awslabs/aws-mobile-appsync-sdk-js","owner":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars0.githubusercontent.com/u/3299148?v=4","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/awslabs/aws-mobile-appsync-sdk-js","description":"JavaScript library files for Offline, Sync, Sigv4. includes support for React Native","fork":false,"url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js","forks_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/forks","keys_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/teams","hooks_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/hooks","issue_events_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/issues/events{/number}","events_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/events","assignees_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/assignees{/user}","branches_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/branches{/branch}","tags_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/tags","blobs_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/statuses/{sha}","languages_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/languages","stargazers_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/stargazers","contributors_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/contributors","subscribers_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/subscribers","subscription_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/subscription","commits_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/contents/{+path}","compare_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/merges","archive_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/downloads","issues_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/issues{/number}","pulls_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls{/number}","milestones_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/milestones{/number}","notifications_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/labels{/name}","releases_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/releases{/id}","deployments_url":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/deployments","created_at":"2017-10-24T17:42:46Z","updated_at":"2018-02-27T15:37:35Z","pushed_at":"2018-02-27T07:36:19Z","git_url":"git://github.com/awslabs/aws-mobile-appsync-sdk-js.git","ssh_url":"git@github.com:awslabs/aws-mobile-appsync-sdk-js.git","clone_url":"https://github.com/awslabs/aws-mobile-appsync-sdk-js.git","svn_url":"https://github.com/awslabs/aws-mobile-appsync-sdk-js","homepage":null,"size":112,"stargazers_count":141,"watchers_count":141,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":18,"open_issues":14,"watchers":141,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls/60"},"html":{"href":"https://github.com/awslabs/aws-mobile-appsync-sdk-js/pull/60"},"issue":{"href":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/issues/60"},"comments":{"href":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/awslabs/aws-mobile-appsync-sdk-js/statuses/f670d063738c0cd1a4c63bfc151b6f5e8480170e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"elorzafe"}}