@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 improper filtering behavior in ConpherenceParticipantQuery

Summary:
Pathway to D17685. This fixes an issue idenified in D17731: if any caller ever queried for more than one participant, some results could get thrown away by re-keying the results on thread PHID: two different participants can be members of the same thread!

This also fixes an issue from D17683, where a `needParticipantCache()` callsite was overlooked.

Test Plan:
- Viewed Conpherence dropdown.
- Sent messages, saw unread count / thread order still work properly.

Reviewers: chad

Reviewed By: chad

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

+5 -19
+2 -3
src/applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php
··· 36 36 $offset = $request->getValue('offset'); 37 37 38 38 $query = id(new ConpherenceThreadQuery()) 39 - ->setViewer($user) 40 - ->needParticipantCache(true); 39 + ->setViewer($user); 41 40 42 41 if ($ids) { 43 42 $conpherences = $query ··· 57 56 ->setLimit($limit) 58 57 ->setOffset($offset) 59 58 ->execute(); 60 - $conpherence_phids = array_keys($participation); 59 + $conpherence_phids = mpull($participation, 'getConpherencePHID'); 61 60 $query->withPHIDs($conpherence_phids); 62 61 $conpherences = $query->execute(); 63 62 $conpherences = array_select_keys($conpherences, $conpherence_phids);
+1
src/applications/conpherence/controller/ConpherenceListController.php
··· 151 151 ->withParticipantPHIDs(array($viewer->getPHID())) 152 152 ->setLimit($limit) 153 153 ->execute(); 154 + $all_participation = mpull($all_participation, null, 'getConpherencePHID'); 154 155 155 156 return array( 156 157 'all_participation' => $all_participation,
+1
src/applications/conpherence/controller/ConpherenceNotificationPanelController.php
··· 12 12 ->withParticipantPHIDs(array($user->getPHID())) 13 13 ->setLimit(5) 14 14 ->execute(); 15 + $participant_data = mpull($participant_data, null, 'getConpherencePHID'); 15 16 16 17 if ($participant_data) { 17 18 $conpherences = id(new ConpherenceThreadQuery())
+1 -16
src/applications/conpherence/query/ConpherenceParticipantQuery.php
··· 25 25 $this->buildOrderClause($conn), 26 26 $this->buildLimitClause($conn)); 27 27 28 - $participants = $table->loadAllFromArray($data); 29 - 30 - // TODO: Fix this, it's bogus. 31 - if ('garbage') { 32 - if (count($this->participantPHIDs) !== 1) { 33 - throw new Exception( 34 - pht( 35 - 'This query only works when querying for exactly one participant '. 36 - 'PHID!')); 37 - } 38 - // This will throw results away if we aren't doing a query for exactly 39 - // one participant PHID. 40 - $participants = mpull($participants, null, 'getConpherencePHID'); 41 - } 42 - 43 - return $participants; 28 + return $table->loadAllFromArray($data); 44 29 } 45 30 46 31 protected function buildWhereClause(AphrontDatabaseConnection $conn) {