{"action":"created","comment":{"url":"https://api.github.com/repos/telefonicaid/context-adapter/pulls/comments/41004661","id":41004661,"diff_hunk":"@@ -183,6 +183,22 @@ function checkUpdateContextRequest(request, callback) {\n }\n \n /**\n+ * Returns true if the updateContext request corresponds to a polling request from the button\n+ * @param {object} request The received request\n+ * @return {boolean} true if the updateContext request corresponds to a polling request from the button,\n+ *  false otherwise\n+ */\n+function isPollingUpdateContext(request) {\n+  if (request && request.payload && request.payload.contextElements && request.payload.contextElements[0]) {\n+    if (caHelper.getAttributeValue(\n+        request.payload.contextElements[0].attributes, caConfig.BUTTON_ENTITY.CA_LAST_OPERATION) === 'P') {","path":"lib/context_adapter_communication.js","position":12,"original_position":12,"commit_id":"05890b6f62f6090fcff3adbac9212208c02076f5","original_commit_id":"05890b6f62f6090fcff3adbac9212208c02076f5","user":{"login":"AlvaroVega","id":983422,"avatar_url":"https://avatars.githubusercontent.com/u/983422?v=3","gravatar_id":"","url":"https://api.github.com/users/AlvaroVega","html_url":"https://github.com/AlvaroVega","followers_url":"https://api.github.com/users/AlvaroVega/followers","following_url":"https://api.github.com/users/AlvaroVega/following{/other_user}","gists_url":"https://api.github.com/users/AlvaroVega/gists{/gist_id}","starred_url":"https://api.github.com/users/AlvaroVega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlvaroVega/subscriptions","organizations_url":"https://api.github.com/users/AlvaroVega/orgs","repos_url":"https://api.github.com/users/AlvaroVega/repos","events_url":"https://api.github.com/users/AlvaroVega/events{/privacy}","received_events_url":"https://api.github.com/users/AlvaroVega/received_events","type":"User","site_admin":false},"body":"Just the first one?","created_at":"2015-10-02T09:27:21Z","updated_at":"2015-10-02T09:27:21Z","html_url":"https://github.com/telefonicaid/context-adapter/pull/22#discussion_r41004661","pull_request_url":"https://api.github.com/repos/telefonicaid/context-adapter/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/telefonicaid/context-adapter/pulls/comments/41004661"},"html":{"href":"https://github.com/telefonicaid/context-adapter/pull/22#discussion_r41004661"},"pull_request":{"href":"https://api.github.com/repos/telefonicaid/context-adapter/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/telefonicaid/context-adapter/pulls/22","id":46616654,"html_url":"https://github.com/telefonicaid/context-adapter/pull/22","diff_url":"https://github.com/telefonicaid/context-adapter/pull/22.diff","patch_url":"https://github.com/telefonicaid/context-adapter/pull/22.patch","issue_url":"https://api.github.com/repos/telefonicaid/context-adapter/issues/22","number":22,"state":"open","locked":false,"title":"Dealing with redirected updateContext requests due to polling","user":{"login":"gtorodelvalle","id":667284,"avatar_url":"https://avatars.githubusercontent.com/u/667284?v=3","gravatar_id":"","url":"https://api.github.com/users/gtorodelvalle","html_url":"https://github.com/gtorodelvalle","followers_url":"https://api.github.com/users/gtorodelvalle/followers","following_url":"https://api.github.com/users/gtorodelvalle/following{/other_user}","gists_url":"https://api.github.com/users/gtorodelvalle/gists{/gist_id}","starred_url":"https://api.github.com/users/gtorodelvalle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtorodelvalle/subscriptions","organizations_url":"https://api.github.com/users/gtorodelvalle/orgs","repos_url":"https://api.github.com/users/gtorodelvalle/repos","events_url":"https://api.github.com/users/gtorodelvalle/events{/privacy}","received_events_url":"https://api.github.com/users/gtorodelvalle/received_events","type":"User","site_admin":false},"body":"- 100% tests passed\r\n- Assigned to @dmoranj ","created_at":"2015-10-02T09:23:33Z","updated_at":"2015-10-02T09:27:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7248745ec14ace50a4047041a263cae9e50f78bd","assignee":{"login":"dmoranj","id":1152892,"avatar_url":"https://avatars.githubusercontent.com/u/1152892?v=3","gravatar_id":"","url":"https://api.github.com/users/dmoranj","html_url":"https://github.com/dmoranj","followers_url":"https://api.github.com/users/dmoranj/followers","following_url":"https://api.github.com/users/dmoranj/following{/other_user}","gists_url":"https://api.github.com/users/dmoranj/gists{/gist_id}","starred_url":"https://api.github.com/users/dmoranj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmoranj/subscriptions","organizations_url":"https://api.github.com/users/dmoranj/orgs","repos_url":"https://api.github.com/users/dmoranj/repos","events_url":"https://api.github.com/users/dmoranj/events{/privacy}","received_events_url":"https://api.github.com/users/dmoranj/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/telefonicaid/context-adapter/pulls/22/commits","review_comments_url":"https://api.github.com/repos/telefonicaid/context-adapter/pulls/22/comments","review_comment_url":"https://api.github.com/repos/telefonicaid/context-adapter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/telefonicaid/context-adapter/issues/22/comments","statuses_url":"https://api.github.com/repos/telefonicaid/context-adapter/statuses/05890b6f62f6090fcff3adbac9212208c02076f5","head":{"label":"telefonicaid:feature/attending-redirected-queryContext-requests","ref":"feature/attending-redirected-queryContext-requests","sha":"05890b6f62f6090fcff3adbac9212208c02076f5","user":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"repo":{"id":40655205,"name":"context-adapter","full_name":"telefonicaid/context-adapter","owner":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telefonicaid/context-adapter","description":"Context Adapter component for the Black Button (Generic Button) platform by Telefónica","fork":false,"url":"https://api.github.com/repos/telefonicaid/context-adapter","forks_url":"https://api.github.com/repos/telefonicaid/context-adapter/forks","keys_url":"https://api.github.com/repos/telefonicaid/context-adapter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telefonicaid/context-adapter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telefonicaid/context-adapter/teams","hooks_url":"https://api.github.com/repos/telefonicaid/context-adapter/hooks","issue_events_url":"https://api.github.com/repos/telefonicaid/context-adapter/issues/events{/number}","events_url":"https://api.github.com/repos/telefonicaid/context-adapter/events","assignees_url":"https://api.github.com/repos/telefonicaid/context-adapter/assignees{/user}","branches_url":"https://api.github.com/repos/telefonicaid/context-adapter/branches{/branch}","tags_url":"https://api.github.com/repos/telefonicaid/context-adapter/tags","blobs_url":"https://api.github.com/repos/telefonicaid/context-adapter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telefonicaid/context-adapter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telefonicaid/context-adapter/git/refs{/sha}","trees_url":"https://api.github.com/repos/telefonicaid/context-adapter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telefonicaid/context-adapter/statuses/{sha}","languages_url":"https://api.github.com/repos/telefonicaid/context-adapter/languages","stargazers_url":"https://api.github.com/repos/telefonicaid/context-adapter/stargazers","contributors_url":"https://api.github.com/repos/telefonicaid/context-adapter/contributors","subscribers_url":"https://api.github.com/repos/telefonicaid/context-adapter/subscribers","subscription_url":"https://api.github.com/repos/telefonicaid/context-adapter/subscription","commits_url":"https://api.github.com/repos/telefonicaid/context-adapter/commits{/sha}","git_commits_url":"https://api.github.com/repos/telefonicaid/context-adapter/git/commits{/sha}","comments_url":"https://api.github.com/repos/telefonicaid/context-adapter/comments{/number}","issue_comment_url":"https://api.github.com/repos/telefonicaid/context-adapter/issues/comments{/number}","contents_url":"https://api.github.com/repos/telefonicaid/context-adapter/contents/{+path}","compare_url":"https://api.github.com/repos/telefonicaid/context-adapter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telefonicaid/context-adapter/merges","archive_url":"https://api.github.com/repos/telefonicaid/context-adapter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telefonicaid/context-adapter/downloads","issues_url":"https://api.github.com/repos/telefonicaid/context-adapter/issues{/number}","pulls_url":"https://api.github.com/repos/telefonicaid/context-adapter/pulls{/number}","milestones_url":"https://api.github.com/repos/telefonicaid/context-adapter/milestones{/number}","notifications_url":"https://api.github.com/repos/telefonicaid/context-adapter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telefonicaid/context-adapter/labels{/name}","releases_url":"https://api.github.com/repos/telefonicaid/context-adapter/releases{/id}","created_at":"2015-08-13T11:29:48Z","updated_at":"2015-09-10T08:50:49Z","pushed_at":"2015-10-02T09:23:33Z","git_url":"git://github.com/telefonicaid/context-adapter.git","ssh_url":"git@github.com:telefonicaid/context-adapter.git","clone_url":"https://github.com/telefonicaid/context-adapter.git","svn_url":"https://github.com/telefonicaid/context-adapter","homepage":"","size":656,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"base":{"label":"telefonicaid:develop","ref":"develop","sha":"f40418188dbf26dda7ea385b7b2cd7089a0f6a08","user":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"repo":{"id":40655205,"name":"context-adapter","full_name":"telefonicaid/context-adapter","owner":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telefonicaid/context-adapter","description":"Context Adapter component for the Black Button (Generic Button) platform by Telefónica","fork":false,"url":"https://api.github.com/repos/telefonicaid/context-adapter","forks_url":"https://api.github.com/repos/telefonicaid/context-adapter/forks","keys_url":"https://api.github.com/repos/telefonicaid/context-adapter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telefonicaid/context-adapter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telefonicaid/context-adapter/teams","hooks_url":"https://api.github.com/repos/telefonicaid/context-adapter/hooks","issue_events_url":"https://api.github.com/repos/telefonicaid/context-adapter/issues/events{/number}","events_url":"https://api.github.com/repos/telefonicaid/context-adapter/events","assignees_url":"https://api.github.com/repos/telefonicaid/context-adapter/assignees{/user}","branches_url":"https://api.github.com/repos/telefonicaid/context-adapter/branches{/branch}","tags_url":"https://api.github.com/repos/telefonicaid/context-adapter/tags","blobs_url":"https://api.github.com/repos/telefonicaid/context-adapter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telefonicaid/context-adapter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telefonicaid/context-adapter/git/refs{/sha}","trees_url":"https://api.github.com/repos/telefonicaid/context-adapter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telefonicaid/context-adapter/statuses/{sha}","languages_url":"https://api.github.com/repos/telefonicaid/context-adapter/languages","stargazers_url":"https://api.github.com/repos/telefonicaid/context-adapter/stargazers","contributors_url":"https://api.github.com/repos/telefonicaid/context-adapter/contributors","subscribers_url":"https://api.github.com/repos/telefonicaid/context-adapter/subscribers","subscription_url":"https://api.github.com/repos/telefonicaid/context-adapter/subscription","commits_url":"https://api.github.com/repos/telefonicaid/context-adapter/commits{/sha}","git_commits_url":"https://api.github.com/repos/telefonicaid/context-adapter/git/commits{/sha}","comments_url":"https://api.github.com/repos/telefonicaid/context-adapter/comments{/number}","issue_comment_url":"https://api.github.com/repos/telefonicaid/context-adapter/issues/comments{/number}","contents_url":"https://api.github.com/repos/telefonicaid/context-adapter/contents/{+path}","compare_url":"https://api.github.com/repos/telefonicaid/context-adapter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telefonicaid/context-adapter/merges","archive_url":"https://api.github.com/repos/telefonicaid/context-adapter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telefonicaid/context-adapter/downloads","issues_url":"https://api.github.com/repos/telefonicaid/context-adapter/issues{/number}","pulls_url":"https://api.github.com/repos/telefonicaid/context-adapter/pulls{/number}","milestones_url":"https://api.github.com/repos/telefonicaid/context-adapter/milestones{/number}","notifications_url":"https://api.github.com/repos/telefonicaid/context-adapter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telefonicaid/context-adapter/labels{/name}","releases_url":"https://api.github.com/repos/telefonicaid/context-adapter/releases{/id}","created_at":"2015-08-13T11:29:48Z","updated_at":"2015-09-10T08:50:49Z","pushed_at":"2015-10-02T09:23:33Z","git_url":"git://github.com/telefonicaid/context-adapter.git","ssh_url":"git@github.com:telefonicaid/context-adapter.git","clone_url":"https://github.com/telefonicaid/context-adapter.git","svn_url":"https://github.com/telefonicaid/context-adapter","homepage":"","size":656,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/telefonicaid/context-adapter/pulls/22"},"html":{"href":"https://github.com/telefonicaid/context-adapter/pull/22"},"issue":{"href":"https://api.github.com/repos/telefonicaid/context-adapter/issues/22"},"comments":{"href":"https://api.github.com/repos/telefonicaid/context-adapter/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/telefonicaid/context-adapter/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/telefonicaid/context-adapter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/telefonicaid/context-adapter/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/telefonicaid/context-adapter/statuses/05890b6f62f6090fcff3adbac9212208c02076f5"}}}}