{"action":"created","comment":{"url":"https://api.github.com/repos/nextcloud/server/pulls/comments/110646719","pull_request_review_id":31832815,"id":110646719,"diff_hunk":"@@ -88,7 +104,20 @@ public function handleGetProperties(\n \t\t});\n \n \t\t$propFind->handle(self::PROPERTY_NAME_UNREAD, function() use ($node) {\n-\t\t\treturn $this->getUnreadCount($node);\n+\t\t\tif (isset($this->cachedUnreadCount[$node->getId()])) {\n+\t\t\t\treturn $this->cachedUnreadCount[$node->getId()];\n+\t\t\t} else {\n+\t\t\t\tlist($parentPath,) = \\Sabre\\Uri\\split($node->getPath());\n+\t\t\t\tif ($parentPath === '') {\n+\t\t\t\t\t$parentPath = '/';\n+\t\t\t\t}\n+\t\t\t\t// if we already cached the folder this file is in we know there are no shares for this file\n+\t\t\t\tif (array_search($parentPath, $this->cachedFolders) === false) {","path":"apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php","position":43,"original_position":43,"commit_id":"11c1e5dd8641e38c44e49d0f527444be7f92da1b","original_commit_id":"11c1e5dd8641e38c44e49d0f527444be7f92da1b","user":{"login":"icewind1991","id":1283854,"avatar_url":"https://avatars2.githubusercontent.com/u/1283854?v=3","gravatar_id":"","url":"https://api.github.com/users/icewind1991","html_url":"https://github.com/icewind1991","followers_url":"https://api.github.com/users/icewind1991/followers","following_url":"https://api.github.com/users/icewind1991/following{/other_user}","gists_url":"https://api.github.com/users/icewind1991/gists{/gist_id}","starred_url":"https://api.github.com/users/icewind1991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icewind1991/subscriptions","organizations_url":"https://api.github.com/users/icewind1991/orgs","repos_url":"https://api.github.com/users/icewind1991/repos","events_url":"https://api.github.com/users/icewind1991/events{/privacy}","received_events_url":"https://api.github.com/users/icewind1991/received_events","type":"User","site_admin":false},"body":"I prefer to use a regular array and array_search here, performance shouldn't matter since this entire branch is an edge case anyway","created_at":"2017-04-10T12:55:37Z","updated_at":"2017-04-10T12:55:38Z","html_url":"https://github.com/nextcloud/server/pull/4146#discussion_r110646719","pull_request_url":"https://api.github.com/repos/nextcloud/server/pulls/4146","_links":{"self":{"href":"https://api.github.com/repos/nextcloud/server/pulls/comments/110646719"},"html":{"href":"https://github.com/nextcloud/server/pull/4146#discussion_r110646719"},"pull_request":{"href":"https://api.github.com/repos/nextcloud/server/pulls/4146"}}},"pull_request":{"url":"https://api.github.com/repos/nextcloud/server/pulls/4146","id":113193505,"html_url":"https://github.com/nextcloud/server/pull/4146","diff_url":"https://github.com/nextcloud/server/pull/4146.diff","patch_url":"https://github.com/nextcloud/server/pull/4146.patch","issue_url":"https://api.github.com/repos/nextcloud/server/issues/4146","number":4146,"state":"open","locked":false,"title":"Allow getting the unread comment count for an entire folder at once","user":{"login":"icewind1991","id":1283854,"avatar_url":"https://avatars2.githubusercontent.com/u/1283854?v=3","gravatar_id":"","url":"https://api.github.com/users/icewind1991","html_url":"https://github.com/icewind1991","followers_url":"https://api.github.com/users/icewind1991/followers","following_url":"https://api.github.com/users/icewind1991/following{/other_user}","gists_url":"https://api.github.com/users/icewind1991/gists{/gist_id}","starred_url":"https://api.github.com/users/icewind1991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icewind1991/subscriptions","organizations_url":"https://api.github.com/users/icewind1991/orgs","repos_url":"https://api.github.com/users/icewind1991/repos","events_url":"https://api.github.com/users/icewind1991/events{/privacy}","received_events_url":"https://api.github.com/users/icewind1991/received_events","type":"User","site_admin":false},"body":"Instead of doing 2 queries per file in a folder, we do a single query to get all unread comment counts.\r\n\r\n[comparison with 100 files](https://blackfire.io/profiles/compare/0f2705d7-7d07-45e8-81eb-f18589fda1d2/graph)","created_at":"2017-03-29T13:09:27Z","updated_at":"2017-04-10T12:55:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28e80afa4aa7ae2d09369c89f1685cc941b7d5d7","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/nextcloud/server/milestones/10","html_url":"https://github.com/nextcloud/server/milestone/10","labels_url":"https://api.github.com/repos/nextcloud/server/milestones/10/labels","id":2136652,"number":10,"title":"Nextcloud 12.0","description":null,"creator":{"login":"jancborchardt","id":925062,"avatar_url":"https://avatars1.githubusercontent.com/u/925062?v=3","gravatar_id":"","url":"https://api.github.com/users/jancborchardt","html_url":"https://github.com/jancborchardt","followers_url":"https://api.github.com/users/jancborchardt/followers","following_url":"https://api.github.com/users/jancborchardt/following{/other_user}","gists_url":"https://api.github.com/users/jancborchardt/gists{/gist_id}","starred_url":"https://api.github.com/users/jancborchardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jancborchardt/subscriptions","organizations_url":"https://api.github.com/users/jancborchardt/orgs","repos_url":"https://api.github.com/users/jancborchardt/repos","events_url":"https://api.github.com/users/jancborchardt/events{/privacy}","received_events_url":"https://api.github.com/users/jancborchardt/received_events","type":"User","site_admin":false},"open_issues":147,"closed_issues":672,"state":"open","created_at":"2016-11-15T13:57:13Z","updated_at":"2017-04-10T10:43:46Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/nextcloud/server/pulls/4146/commits","review_comments_url":"https://api.github.com/repos/nextcloud/server/pulls/4146/comments","review_comment_url":"https://api.github.com/repos/nextcloud/server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nextcloud/server/issues/4146/comments","statuses_url":"https://api.github.com/repos/nextcloud/server/statuses/11c1e5dd8641e38c44e49d0f527444be7f92da1b","head":{"label":"nextcloud:unread-comments-folder","ref":"unread-comments-folder","sha":"11c1e5dd8641e38c44e49d0f527444be7f92da1b","user":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars2.githubusercontent.com/u/19211038?v=3","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":60243197,"name":"server","full_name":"nextcloud/server","owner":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars2.githubusercontent.com/u/19211038?v=3","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nextcloud/server","description":"☁️ Nextcloud server, a safe home for all your data","fork":false,"url":"https://api.github.com/repos/nextcloud/server","forks_url":"https://api.github.com/repos/nextcloud/server/forks","keys_url":"https://api.github.com/repos/nextcloud/server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nextcloud/server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nextcloud/server/teams","hooks_url":"https://api.github.com/repos/nextcloud/server/hooks","issue_events_url":"https://api.github.com/repos/nextcloud/server/issues/events{/number}","events_url":"https://api.github.com/repos/nextcloud/server/events","assignees_url":"https://api.github.com/repos/nextcloud/server/assignees{/user}","branches_url":"https://api.github.com/repos/nextcloud/server/branches{/branch}","tags_url":"https://api.github.com/repos/nextcloud/server/tags","blobs_url":"https://api.github.com/repos/nextcloud/server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nextcloud/server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nextcloud/server/git/refs{/sha}","trees_url":"https://api.github.com/repos/nextcloud/server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nextcloud/server/statuses/{sha}","languages_url":"https://api.github.com/repos/nextcloud/server/languages","stargazers_url":"https://api.github.com/repos/nextcloud/server/stargazers","contributors_url":"https://api.github.com/repos/nextcloud/server/contributors","subscribers_url":"https://api.github.com/repos/nextcloud/server/subscribers","subscription_url":"https://api.github.com/repos/nextcloud/server/subscription","commits_url":"https://api.github.com/repos/nextcloud/server/commits{/sha}","git_commits_url":"https://api.github.com/repos/nextcloud/server/git/commits{/sha}","comments_url":"https://api.github.com/repos/nextcloud/server/comments{/number}","issue_comment_url":"https://api.github.com/repos/nextcloud/server/issues/comments{/number}","contents_url":"https://api.github.com/repos/nextcloud/server/contents/{+path}","compare_url":"https://api.github.com/repos/nextcloud/server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nextcloud/server/merges","archive_url":"https://api.github.com/repos/nextcloud/server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nextcloud/server/downloads","issues_url":"https://api.github.com/repos/nextcloud/server/issues{/number}","pulls_url":"https://api.github.com/repos/nextcloud/server/pulls{/number}","milestones_url":"https://api.github.com/repos/nextcloud/server/milestones{/number}","notifications_url":"https://api.github.com/repos/nextcloud/server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nextcloud/server/labels{/name}","releases_url":"https://api.github.com/repos/nextcloud/server/releases{/id}","deployments_url":"https://api.github.com/repos/nextcloud/server/deployments","created_at":"2016-06-02T07:44:14Z","updated_at":"2017-04-10T08:59:00Z","pushed_at":"2017-04-10T12:31:18Z","git_url":"git://github.com/nextcloud/server.git","ssh_url":"git@github.com:nextcloud/server.git","clone_url":"https://github.com/nextcloud/server.git","svn_url":"https://github.com/nextcloud/server","homepage":"https://nextcloud.com","size":236258,"stargazers_count":1683,"watchers_count":1683,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":274,"mirror_url":null,"open_issues_count":767,"forks":274,"open_issues":767,"watchers":1683,"default_branch":"master"}},"base":{"label":"nextcloud:master","ref":"master","sha":"1ee7e1c0b128b16c3327ca6aa90335ce12fd678f","user":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars2.githubusercontent.com/u/19211038?v=3","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":60243197,"name":"server","full_name":"nextcloud/server","owner":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars2.githubusercontent.com/u/19211038?v=3","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nextcloud/server","description":"☁️ Nextcloud server, a safe home for all your data","fork":false,"url":"https://api.github.com/repos/nextcloud/server","forks_url":"https://api.github.com/repos/nextcloud/server/forks","keys_url":"https://api.github.com/repos/nextcloud/server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nextcloud/server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nextcloud/server/teams","hooks_url":"https://api.github.com/repos/nextcloud/server/hooks","issue_events_url":"https://api.github.com/repos/nextcloud/server/issues/events{/number}","events_url":"https://api.github.com/repos/nextcloud/server/events","assignees_url":"https://api.github.com/repos/nextcloud/server/assignees{/user}","branches_url":"https://api.github.com/repos/nextcloud/server/branches{/branch}","tags_url":"https://api.github.com/repos/nextcloud/server/tags","blobs_url":"https://api.github.com/repos/nextcloud/server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nextcloud/server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nextcloud/server/git/refs{/sha}","trees_url":"https://api.github.com/repos/nextcloud/server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nextcloud/server/statuses/{sha}","languages_url":"https://api.github.com/repos/nextcloud/server/languages","stargazers_url":"https://api.github.com/repos/nextcloud/server/stargazers","contributors_url":"https://api.github.com/repos/nextcloud/server/contributors","subscribers_url":"https://api.github.com/repos/nextcloud/server/subscribers","subscription_url":"https://api.github.com/repos/nextcloud/server/subscription","commits_url":"https://api.github.com/repos/nextcloud/server/commits{/sha}","git_commits_url":"https://api.github.com/repos/nextcloud/server/git/commits{/sha}","comments_url":"https://api.github.com/repos/nextcloud/server/comments{/number}","issue_comment_url":"https://api.github.com/repos/nextcloud/server/issues/comments{/number}","contents_url":"https://api.github.com/repos/nextcloud/server/contents/{+path}","compare_url":"https://api.github.com/repos/nextcloud/server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nextcloud/server/merges","archive_url":"https://api.github.com/repos/nextcloud/server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nextcloud/server/downloads","issues_url":"https://api.github.com/repos/nextcloud/server/issues{/number}","pulls_url":"https://api.github.com/repos/nextcloud/server/pulls{/number}","milestones_url":"https://api.github.com/repos/nextcloud/server/milestones{/number}","notifications_url":"https://api.github.com/repos/nextcloud/server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nextcloud/server/labels{/name}","releases_url":"https://api.github.com/repos/nextcloud/server/releases{/id}","deployments_url":"https://api.github.com/repos/nextcloud/server/deployments","created_at":"2016-06-02T07:44:14Z","updated_at":"2017-04-10T08:59:00Z","pushed_at":"2017-04-10T12:31:18Z","git_url":"git://github.com/nextcloud/server.git","ssh_url":"git@github.com:nextcloud/server.git","clone_url":"https://github.com/nextcloud/server.git","svn_url":"https://github.com/nextcloud/server","homepage":"https://nextcloud.com","size":236258,"stargazers_count":1683,"watchers_count":1683,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":274,"mirror_url":null,"open_issues_count":767,"forks":274,"open_issues":767,"watchers":1683,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nextcloud/server/pulls/4146"},"html":{"href":"https://github.com/nextcloud/server/pull/4146"},"issue":{"href":"https://api.github.com/repos/nextcloud/server/issues/4146"},"comments":{"href":"https://api.github.com/repos/nextcloud/server/issues/4146/comments"},"review_comments":{"href":"https://api.github.com/repos/nextcloud/server/pulls/4146/comments"},"review_comment":{"href":"https://api.github.com/repos/nextcloud/server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nextcloud/server/pulls/4146/commits"},"statuses":{"href":"https://api.github.com/repos/nextcloud/server/statuses/11c1e5dd8641e38c44e49d0f527444be7f92da1b"}}}}
{"actor":{"display_login":"icewind1991"}}