@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

When computing the "Subscribers" policy, use materialized membership

Summary:
Fixes T13104. The "Subscribers" policy implementation still uses older logic to query project membership and misses parent projects and milestones which a user is a member of.

Instead of doing an edge query for explicit membership, use a project query to find all projects the viewer belongs to.

Test Plan:
- Created a parent project A.
- Created a subproject B.
- As Bailey, created a task with "Visible To: Bailey, Subscribers".
- Added parent project A as a task subscriber.

Then:

- As Alice, verified I could not see the task.
- As Alice, joined subproject B.
- Before patch: still unable to see the task.
- After patch: can see the task.
- Removed parent project A as a subscriber, verified I could no longer see the task.

Maniphest Tasks: T13104

Differential Revision: https://secure.phabricator.com/D19213

+7 -3
+7 -3
src/applications/subscriptions/policyrule/PhabricatorSubscriptionsSubscribersPolicyRule.php
··· 47 47 48 48 // Load the project PHIDs the user is a member of. 49 49 if (!isset($this->sourcePHIDs[$viewer_phid])) { 50 - $source_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( 51 - $viewer_phid, 52 - PhabricatorProjectMemberOfProjectEdgeType::EDGECONST); 50 + $projects = id(new PhabricatorProjectQuery()) 51 + ->setViewer($viewer) 52 + ->withMemberPHIDs(array($viewer_phid)) 53 + ->execute(); 54 + 55 + $source_phids = mpull($projects, 'getPHID'); 53 56 $source_phids[] = $viewer_phid; 57 + 54 58 $this->sourcePHIDs[$viewer_phid] = $source_phids; 55 59 } 56 60