@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.

Fix an issue with mentions in transactions

Ref T6367. Fixes T8415.

Maniphest filters transactions too early. This happens automatically later. Remove the code.

Transactions should be filtered per-user. If a transaction is hidden for some users, we shouldn't mail them. Move the filtering logic to be per-user.

Stack:

```
[Thu Jun 04 05:51:05.371061 2015] [:error] [pid 25111] [client 127.0.0.1:56497] [2015-06-04 05:51:05] EXCEPTION: (Exception) Transaction ("PHID-XACT-TASK-x4jlylat47s6ttr", of type "core:edge") requires a handle ("PHID-DREV-rs7jaoxbcb3av6biq4b5") that it did not load. at [<phabricator>/src/applications/transactions/storage/PhabricatorApplicationTransaction.php:277]
[Thu Jun 04 05:51:05.372546 2015] [:error] [pid 25111] [client 127.0.0.1:56497] arcanist(head=master, ref.master=4e83efb31d3e), instances(head=master, ref.master=db56d5d6ad91), ledger(head=master, ref.master=5694485699a4), libcore(), phabricator(head=xaction1, ref.master=04a22a8fa443, ref.xaction1=04a22a8fa443, custom=17), phutil(head=master, ref.master=c2cd90ee7aec), services(head=master, ref.master=2d76591c4f87)
[Thu Jun 04 05:51:05.372559 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #0 <#2> PhabricatorApplicationTransaction::getHandle(string) called at [<phabricator>/src/applications/transactions/storage/PhabricatorApplicationTransaction.php:463]
[Thu Jun 04 05:51:05.372564 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #1 <#2> PhabricatorApplicationTransaction::shouldHide() called at [<phabricator>/src/applications/maniphest/storage/ManiphestTransaction.php:163]
[Thu Jun 04 05:51:05.372568 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #2 <#2> ManiphestTransaction::shouldHide() called at [<phutil>/src/utils/utils.php:428]
[Thu Jun 04 05:51:05.372572 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #3 <#2> mfilter(array, string, boolean) called at [<phabricator>/src/applications/maniphest/editor/ManiphestTransactionEditor.php:380]
[Thu Jun 04 05:51:05.372576 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #4 <#2> ManiphestTransactionEditor::shouldSendMail(ManiphestTask, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:957]
[Thu Jun 04 05:51:05.372580 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #5 <#2> PhabricatorApplicationTransactionEditor::applyTransactions(ManiphestTask, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2858]
[Thu Jun 04 05:51:05.372585 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #6 <#2> PhabricatorApplicationTransactionEditor::applyInverseEdgeTransactions(DifferentialRevision, DifferentialTransaction, integer) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:569]
[Thu Jun 04 05:51:05.372589 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #7 <#2> PhabricatorApplicationTransactionEditor::applyBuiltinExternalTransaction(DifferentialRevision, DifferentialTransaction) called at [<phabricator>/src/applications/differential/editor/DifferentialTransactionEditor.php:615]
[Thu Jun 04 05:51:05.372594 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #8 <#2> DifferentialTransactionEditor::applyBuiltinExternalTransaction(DifferentialRevision, DifferentialTransaction) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:489]
[Thu Jun 04 05:51:05.372611 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #9 <#2> PhabricatorApplicationTransactionEditor::applyExternalEffects(DifferentialRevision, DifferentialTransaction) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:827]
[Thu Jun 04 05:51:05.372616 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #10 <#2> PhabricatorApplicationTransactionEditor::applyTransactions(DifferentialRevision, array) called at [<phabricator>/src/applications/differential/controller/DifferentialCommentSaveController.php:124]
[Thu Jun 04 05:51:05.372621 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #11 <#2> DifferentialCommentSaveController::processRequest() called at [<phabricator>/src/aphront/AphrontController.php:33]
[Thu Jun 04 05:51:05.372625 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #12 <#2> AphrontController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:226]
[Thu Jun 04 05:51:05.372629 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #13 phlog(Exception) called at [<phabricator>/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php:226]
[Thu Jun 04 05:51:05.372633 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #14 AphrontDefaultApplicationConfiguration::handleException(Exception) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:230]
[Thu Jun 04 05:51:05.372637 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #15 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:140]
[Thu Jun 04 05:51:05.372641 2015] [:error] [pid 25111] [client 127.0.0.1:56497] #16 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:19]
```

Auditors: btrahan

+20 -25
-8
src/applications/maniphest/editor/ManiphestTransactionEditor.php
··· 373 373 return $xactions; 374 374 } 375 375 376 - protected function shouldSendMail( 377 - PhabricatorLiskDAO $object, 378 - array $xactions) { 379 - 380 - $xactions = mfilter($xactions, 'shouldHide', true); 381 - return $xactions; 382 - } 383 - 384 376 protected function getMailSubjectPrefix() { 385 377 return PhabricatorEnv::getEnvConfig('metamta.maniphest.subject-prefix'); 386 378 }
+20 -17
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 2110 2110 PhabricatorLiskDAO $object, 2111 2111 array $xactions) { 2112 2112 2113 - // Check if any of the transactions are visible. If we don't have any 2114 - // visible transactions, don't send the mail. 2115 - 2116 - $any_visible = false; 2117 - foreach ($xactions as $xaction) { 2118 - if (!$xaction->shouldHideForMail($xactions)) { 2119 - $any_visible = true; 2120 - break; 2121 - } 2122 - } 2123 - 2124 - if (!$any_visible) { 2125 - return array(); 2126 - } 2127 - 2128 2113 $email_to = $this->mailToPHIDs; 2129 2114 $email_cc = $this->mailCCPHIDs; 2130 2115 $email_cc = array_merge($email_cc, $this->heraldEmailPHIDs); ··· 2145 2130 $locale = PhabricatorEnv::beginScopedLocale($viewer->getTranslation()); 2146 2131 2147 2132 $caught = null; 2133 + $mail = null; 2148 2134 try { 2149 2135 // Reload handles for the new viewer. 2150 2136 $this->loadHandles($xactions); ··· 2161 2147 throw $ex; 2162 2148 } 2163 2149 2164 - foreach ($mail->buildRecipientList() as $phid) { 2165 - $mailed[$phid] = true; 2150 + if ($mail) { 2151 + foreach ($mail->buildRecipientList() as $phid) { 2152 + $mailed[$phid] = true; 2153 + } 2166 2154 } 2167 2155 } 2168 2156 ··· 2173 2161 PhabricatorLiskDAO $object, 2174 2162 array $xactions, 2175 2163 PhabricatorMailTarget $target) { 2164 + 2165 + // Check if any of the transactions are visible for this viewer. If we 2166 + // don't have any visible transactions, don't send the mail. 2167 + 2168 + $any_visible = false; 2169 + foreach ($xactions as $xaction) { 2170 + if (!$xaction->shouldHideForMail($xactions)) { 2171 + $any_visible = true; 2172 + break; 2173 + } 2174 + } 2175 + 2176 + if (!$any_visible) { 2177 + return null; 2178 + } 2176 2179 2177 2180 $mail = $this->buildMailTemplate($object); 2178 2181 $body = $this->buildMailBody($object, $xactions);