{"action":"created","comment":{"url":"https://api.github.com/repos/hypothesis/client/pulls/comments/149597099","pull_request_review_id":75014474,"id":149597099,"diff_hunk":"@@ -265,19 +264,16 @@ function addAnnotations(annotations, now) {\n     var anchoringAnnots = added.filter(metadata.isWaitingToAnchor);\n     if (anchoringAnnots.length) {\n       setTimeout(function () {\n-        arrayUtil\n+        var statusUpdates = arrayUtil\n           .filterMap(anchoringAnnots, function (annot) {\n             return findByID(getState().annotations, annot.id);\n           })\n           .filter(metadata.isWaitingToAnchor)\n-          .forEach(function (orphan) {\n-            dispatch({\n-              type: actions.UPDATE_ANCHOR_STATUS,\n-              anchorTimeout: true,\n-              id: orphan.id,\n-              tag: orphan.$tag,\n-            });\n-          });\n+          .reduce((statusUpdates, orphan) => {\n+            statusUpdates[orphan.$tag] = 'timeout';\n+            return statusUpdates;\n+          }, {});\n+        dispatch(updateAnchorStatus(statusUpdates));","path":"src/sidebar/reducers/annotations.js","position":null,"original_position":48,"commit_id":"bb190ce8e4c9182149ca3db72898edf9d742e7d9","original_commit_id":"fcff02425881851b6b726b2d00af75b7e91a133a","user":{"login":"robertknight","id":2458,"avatar_url":"https://avatars1.githubusercontent.com/u/2458?v=4","gravatar_id":"","url":"https://api.github.com/users/robertknight","html_url":"https://github.com/robertknight","followers_url":"https://api.github.com/users/robertknight/followers","following_url":"https://api.github.com/users/robertknight/following{/other_user}","gists_url":"https://api.github.com/users/robertknight/gists{/gist_id}","starred_url":"https://api.github.com/users/robertknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertknight/subscriptions","organizations_url":"https://api.github.com/users/robertknight/orgs","repos_url":"https://api.github.com/users/robertknight/repos","events_url":"https://api.github.com/users/robertknight/events{/privacy}","received_events_url":"https://api.github.com/users/robertknight/received_events","type":"User","site_admin":false},"body":"Thanks for the feedback. I rewrote this piece of code. Please let me know if it seems clearer now.","created_at":"2017-11-08T08:07:20Z","updated_at":"2017-11-08T08:07:21Z","html_url":"https://github.com/hypothesis/client/pull/559#discussion_r149597099","pull_request_url":"https://api.github.com/repos/hypothesis/client/pulls/559","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/hypothesis/client/pulls/comments/149597099"},"html":{"href":"https://github.com/hypothesis/client/pull/559#discussion_r149597099"},"pull_request":{"href":"https://api.github.com/repos/hypothesis/client/pulls/559"}},"in_reply_to_id":149466345},"pull_request":{"url":"https://api.github.com/repos/hypothesis/client/pulls/559","id":147939237,"html_url":"https://github.com/hypothesis/client/pull/559","diff_url":"https://github.com/hypothesis/client/pull/559.diff","patch_url":"https://github.com/hypothesis/client/pull/559.patch","issue_url":"https://api.github.com/repos/hypothesis/client/issues/559","number":559,"state":"open","locked":false,"title":"Coalesce anchoring status updates","user":{"login":"robertknight","id":2458,"avatar_url":"https://avatars1.githubusercontent.com/u/2458?v=4","gravatar_id":"","url":"https://api.github.com/users/robertknight","html_url":"https://github.com/robertknight","followers_url":"https://api.github.com/users/robertknight/followers","following_url":"https://api.github.com/users/robertknight/following{/other_user}","gists_url":"https://api.github.com/users/robertknight/gists{/gist_id}","starred_url":"https://api.github.com/users/robertknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertknight/subscriptions","organizations_url":"https://api.github.com/users/robertknight/orgs","repos_url":"https://api.github.com/users/robertknight/repos","events_url":"https://api.github.com/users/robertknight/events{/privacy}","received_events_url":"https://api.github.com/users/robertknight/received_events","type":"User","site_admin":false},"body":"Profiling the test case in #556 showed significant overhead from the\r\nprocessing involved in or triggered by each `UPDATE_ANCHOR_STATUS`\r\naction handled by the store. Previously one `UPDATE_ANCHOR_STATUS`\r\naction was dispatched for each annotation whose anchoring status\r\nchanged.\r\n\r\nImprove the situation by making the `UPDATE_ANCHOR_STATUS` action handle\r\nupdates for multiple annotations at once and modifying the `frameSync`\r\nservice to coalesce anchoring status updates from the host page into\r\na smaller number of `UPDATE_ANCHOR_STATUS` actions.\r\n\r\nThis commit also takes the opportunity to remove the logic to update\r\nannotation tags when handling this action since it is no longer\r\nrequired.\r\n\r\nWith this change the test case in #556 is not perfectly smooth, but it is significantly better and good enough to be usable on many systems.\r\n\r\nFixes #556","created_at":"2017-10-21T10:57:34Z","updated_at":"2017-11-08T08:07:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7024f7e8f24bba7db9c3a8f98abe74b65744ee6","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/hypothesis/client/pulls/559/commits","review_comments_url":"https://api.github.com/repos/hypothesis/client/pulls/559/comments","review_comment_url":"https://api.github.com/repos/hypothesis/client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hypothesis/client/issues/559/comments","statuses_url":"https://api.github.com/repos/hypothesis/client/statuses/bb190ce8e4c9182149ca3db72898edf9d742e7d9","head":{"label":"hypothesis:coalesce-anchor-status-updates","ref":"coalesce-anchor-status-updates","sha":"bb190ce8e4c9182149ca3db72898edf9d742e7d9","user":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars1.githubusercontent.com/u/1243215?v=4","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"repo":{"id":62234930,"name":"client","full_name":"hypothesis/client","owner":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars1.githubusercontent.com/u/1243215?v=4","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hypothesis/client","description":"The Hypothesis web-based annotation client.","fork":false,"url":"https://api.github.com/repos/hypothesis/client","forks_url":"https://api.github.com/repos/hypothesis/client/forks","keys_url":"https://api.github.com/repos/hypothesis/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypothesis/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypothesis/client/teams","hooks_url":"https://api.github.com/repos/hypothesis/client/hooks","issue_events_url":"https://api.github.com/repos/hypothesis/client/issues/events{/number}","events_url":"https://api.github.com/repos/hypothesis/client/events","assignees_url":"https://api.github.com/repos/hypothesis/client/assignees{/user}","branches_url":"https://api.github.com/repos/hypothesis/client/branches{/branch}","tags_url":"https://api.github.com/repos/hypothesis/client/tags","blobs_url":"https://api.github.com/repos/hypothesis/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypothesis/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypothesis/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypothesis/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypothesis/client/statuses/{sha}","languages_url":"https://api.github.com/repos/hypothesis/client/languages","stargazers_url":"https://api.github.com/repos/hypothesis/client/stargazers","contributors_url":"https://api.github.com/repos/hypothesis/client/contributors","subscribers_url":"https://api.github.com/repos/hypothesis/client/subscribers","subscription_url":"https://api.github.com/repos/hypothesis/client/subscription","commits_url":"https://api.github.com/repos/hypothesis/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypothesis/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypothesis/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypothesis/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/hypothesis/client/contents/{+path}","compare_url":"https://api.github.com/repos/hypothesis/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypothesis/client/merges","archive_url":"https://api.github.com/repos/hypothesis/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypothesis/client/downloads","issues_url":"https://api.github.com/repos/hypothesis/client/issues{/number}","pulls_url":"https://api.github.com/repos/hypothesis/client/pulls{/number}","milestones_url":"https://api.github.com/repos/hypothesis/client/milestones{/number}","notifications_url":"https://api.github.com/repos/hypothesis/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypothesis/client/labels{/name}","releases_url":"https://api.github.com/repos/hypothesis/client/releases{/id}","deployments_url":"https://api.github.com/repos/hypothesis/client/deployments","created_at":"2016-06-29T15:02:29Z","updated_at":"2017-10-20T02:23:55Z","pushed_at":"2017-11-08T08:06:16Z","git_url":"git://github.com/hypothesis/client.git","ssh_url":"git@github.com:hypothesis/client.git","clone_url":"https://github.com/hypothesis/client.git","svn_url":"https://github.com/hypothesis/client","homepage":null,"size":16218,"stargazers_count":89,"watchers_count":89,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"archived":false,"open_issues_count":99,"forks":46,"open_issues":99,"watchers":89,"default_branch":"master"}},"base":{"label":"hypothesis:master","ref":"master","sha":"05dc0a5d34d95d5f408fe570786e07029bc1835e","user":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars1.githubusercontent.com/u/1243215?v=4","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"repo":{"id":62234930,"name":"client","full_name":"hypothesis/client","owner":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars1.githubusercontent.com/u/1243215?v=4","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hypothesis/client","description":"The Hypothesis web-based annotation client.","fork":false,"url":"https://api.github.com/repos/hypothesis/client","forks_url":"https://api.github.com/repos/hypothesis/client/forks","keys_url":"https://api.github.com/repos/hypothesis/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypothesis/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypothesis/client/teams","hooks_url":"https://api.github.com/repos/hypothesis/client/hooks","issue_events_url":"https://api.github.com/repos/hypothesis/client/issues/events{/number}","events_url":"https://api.github.com/repos/hypothesis/client/events","assignees_url":"https://api.github.com/repos/hypothesis/client/assignees{/user}","branches_url":"https://api.github.com/repos/hypothesis/client/branches{/branch}","tags_url":"https://api.github.com/repos/hypothesis/client/tags","blobs_url":"https://api.github.com/repos/hypothesis/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypothesis/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypothesis/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypothesis/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypothesis/client/statuses/{sha}","languages_url":"https://api.github.com/repos/hypothesis/client/languages","stargazers_url":"https://api.github.com/repos/hypothesis/client/stargazers","contributors_url":"https://api.github.com/repos/hypothesis/client/contributors","subscribers_url":"https://api.github.com/repos/hypothesis/client/subscribers","subscription_url":"https://api.github.com/repos/hypothesis/client/subscription","commits_url":"https://api.github.com/repos/hypothesis/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypothesis/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypothesis/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypothesis/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/hypothesis/client/contents/{+path}","compare_url":"https://api.github.com/repos/hypothesis/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypothesis/client/merges","archive_url":"https://api.github.com/repos/hypothesis/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypothesis/client/downloads","issues_url":"https://api.github.com/repos/hypothesis/client/issues{/number}","pulls_url":"https://api.github.com/repos/hypothesis/client/pulls{/number}","milestones_url":"https://api.github.com/repos/hypothesis/client/milestones{/number}","notifications_url":"https://api.github.com/repos/hypothesis/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypothesis/client/labels{/name}","releases_url":"https://api.github.com/repos/hypothesis/client/releases{/id}","deployments_url":"https://api.github.com/repos/hypothesis/client/deployments","created_at":"2016-06-29T15:02:29Z","updated_at":"2017-10-20T02:23:55Z","pushed_at":"2017-11-08T08:06:16Z","git_url":"git://github.com/hypothesis/client.git","ssh_url":"git@github.com:hypothesis/client.git","clone_url":"https://github.com/hypothesis/client.git","svn_url":"https://github.com/hypothesis/client","homepage":null,"size":16218,"stargazers_count":89,"watchers_count":89,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"archived":false,"open_issues_count":99,"forks":46,"open_issues":99,"watchers":89,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hypothesis/client/pulls/559"},"html":{"href":"https://github.com/hypothesis/client/pull/559"},"issue":{"href":"https://api.github.com/repos/hypothesis/client/issues/559"},"comments":{"href":"https://api.github.com/repos/hypothesis/client/issues/559/comments"},"review_comments":{"href":"https://api.github.com/repos/hypothesis/client/pulls/559/comments"},"review_comment":{"href":"https://api.github.com/repos/hypothesis/client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hypothesis/client/pulls/559/commits"},"statuses":{"href":"https://api.github.com/repos/hypothesis/client/statuses/bb190ce8e4c9182149ca3db72898edf9d742e7d9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"robertknight"}}