From cd406948fec754026e17f845a59d4a0566127113 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 19 Nov 2014 13:05:43 -0800 Subject: [PATCH] Don't compute a nonsensical assigned task count for logged-out users Summary: When a logged-out user views the home page, we currently compute a meaningless "assigned tasks" count which just counts every open task. Don't do this. Ideally `ManiphestTaskQuery` should get some tightening up too (that is, `withOwners(array(null))` should not select every task), but that might affect other stuff and the performance implications of counting every open task are affecting WMF, so just fix the immediate issue for now. Test Plan: - Viewed homepage as a logged out user, no assigned task count. - Viewed homepage as a logged-in user, still saw assigned task count. Reviewers: btrahan, chad, chasemp Reviewed By: chasemp Subscribers: 20after4, epriestley Differential Revision: https://secure.phabricator.com/D10876 --- .../maniphest/application/PhabricatorManiphestApplication.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/applications/maniphest/application/PhabricatorManiphestApplication.php b/src/applications/maniphest/application/PhabricatorManiphestApplication.php index 3e42eadeae..4a26bb7138 100644 --- a/src/applications/maniphest/application/PhabricatorManiphestApplication.php +++ b/src/applications/maniphest/application/PhabricatorManiphestApplication.php @@ -75,6 +75,10 @@ final class PhabricatorManiphestApplication extends PhabricatorApplication { public function loadStatus(PhabricatorUser $user) { $status = array(); + if (!$user->isLoggedIn()) { + return $status; + } + $query = id(new ManiphestTaskQuery()) ->setViewer($user) ->withStatuses(ManiphestTaskStatus::getOpenStatusConstants())