From f1a7eb66da36acc6313002af6e51f092e699ea0f Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 28 Mar 2019 16:14:47 -0700 Subject: [PATCH] Fix a straggling issue with cursor changes impacting Conpherence thread indexing Summary: Ref T13266. Caught one more of these "directly setting afterID" issues in the logs. Test Plan: Ran `bin/search index --type ConpherenceThread` before and after changes. Before: fatal about a direct call. After: clean index rebuild. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13266 Differential Revision: https://secure.phabricator.com/D20341 --- .../ConpherenceThreadIndexEngineExtension.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/applications/conpherence/engineextension/ConpherenceThreadIndexEngineExtension.php b/src/applications/conpherence/engineextension/ConpherenceThreadIndexEngineExtension.php index d45e347729..740a1d81e2 100644 --- a/src/applications/conpherence/engineextension/ConpherenceThreadIndexEngineExtension.php +++ b/src/applications/conpherence/engineextension/ConpherenceThreadIndexEngineExtension.php @@ -51,13 +51,16 @@ final class ConpherenceThreadIndexEngineExtension ConpherenceThread $thread, ConpherenceTransaction $xaction) { - $previous = id(new ConpherenceTransactionQuery()) + $pager = id(new AphrontCursorPagerView()) + ->setPageSize(1) + ->setAfterID($xaction->getID()); + + $previous_xactions = id(new ConpherenceTransactionQuery()) ->setViewer($this->getViewer()) ->withObjectPHIDs(array($thread->getPHID())) ->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT)) - ->setAfterID($xaction->getID()) - ->setLimit(1) - ->executeOne(); + ->executeWithCursorPager($pager); + $previous = head($previous_xactions); $index = id(new ConpherenceIndex()) ->setThreadPHID($thread->getPHID())