@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 Herald changes object subscribers, always hide the feed story

Summary:
Fixes T8952. These feed stories are not interesting and tend to be generated as collateral damage when a non-story update is made to an old task and someone has a "subscribe me" Herald rule.

Also clean up some of the Herald field/condition indexing behavior slightly.

Test Plan: Wrote a "Subscribe X" herald rule, made a trivial update to a task. Before: low-value feed story; after: no feed story.

Maniphest Tasks: T8952

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

+19 -17
+12 -11
src/applications/herald/field/HeraldField.php
··· 177 177 } 178 178 179 179 public function getPHIDsAffectedByCondition(HeraldCondition $condition) { 180 - $phids = array(); 180 + try { 181 + $standard_type = $this->getHeraldFieldStandardType(); 182 + } catch (PhutilMethodNotImplementedException $ex) { 183 + $standard_type = null; 184 + } 181 185 182 - $standard_type = $this->getHeraldFieldStandardType(); 183 186 switch ($standard_type) { 184 187 case self::STANDARD_PHID: 185 188 case self::STANDARD_PHID_NULLABLE: 186 - $phid = $condition->getValue(); 187 - if ($phid) { 188 - $phids[] = $phid; 189 - } 190 - break; 191 189 case self::STANDARD_PHID_LIST: 192 - foreach ($condition->getValue() as $phid) { 193 - $phids[] = $phid; 190 + $phids = $condition->getValue(); 191 + 192 + if (!is_array($phids)) { 193 + $phids = array(); 194 194 } 195 - break; 195 + 196 + return $phids; 196 197 } 197 198 198 - return $phids; 199 + return array(); 199 200 } 200 201 201 202 final public function setAdapter(HeraldAdapter $adapter) {
+7 -6
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 775 775 case PhabricatorTransactions::TYPE_TOKEN: 776 776 case PhabricatorTransactions::TYPE_MFA: 777 777 return true; 778 + case PhabricatorTransactions::TYPE_SUBSCRIBERS: 779 + // See T8952. When an application (usually Herald) modifies 780 + // subscribers, this tends to be very uninteresting. 781 + if ($this->isApplicationAuthor()) { 782 + return true; 783 + } 784 + break; 778 785 case PhabricatorTransactions::TYPE_EDGE: 779 786 $edge_type = $this->getMetadataValue('edge:type'); 780 787 switch ($edge_type) { ··· 1385 1392 if ($this->isSelfSubscription()) { 1386 1393 // Make this weaker than TYPE_COMMENT. 1387 1394 return 25; 1388 - } 1389 - 1390 - if ($this->isApplicationAuthor()) { 1391 - // When applications (most often: Herald) change subscriptions it 1392 - // is very uninteresting. 1393 - return 1; 1394 1395 } 1395 1396 1396 1397 // In other cases, subscriptions are more interesting than comments