Skip to content

Commit 26f7b69

Browse files
committed
Conpherence - fix a fatal
Summary: Ref T7795. I can't get this to reproduce and its confusing to me how its possible. The trace in T7795 uses the "LOAD" pathway on the update controller. Under the hood, this issues a ThreadQuery with needTransactions to true. With needTransactions to true, the transactions and pertinent handles are all loaded nicely. So... best guess is there has been some LIMIT of transactions since the offending person participated...? Alternative fix which would probably work is to specify needParticipantCache to true. More on T7795 - the user report found the "a, b, c..." subtitle thing in the messages dropdown confusing. Yet another fix here would be to change that to be something like "a: snippet of what a said...". I'll discuss that on the task. Test Plan: iiam Reviewers: epriestley Reviewed By: epriestley Subscribers: nevogd, Korvin, epriestley Maniphest Tasks: T7795 Differential Revision: https://secure.phabricator.com/D12336
1 parent d44f05e commit 26f7b69

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/applications/conpherence/controller/ConpherenceUpdateController.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public function handleRequest(AphrontRequest $request) {
1010
return new Aphront404Response();
1111
}
1212

13+
$need_participants = false;
1314
$needed_capabilities = array(PhabricatorPolicyCapability::CAN_VIEW);
1415
$action = $request->getStr('action', ConpherenceUpdateActions::METADATA);
1516
switch ($action) {
@@ -26,12 +27,17 @@ public function handleRequest(AphrontRequest $request) {
2627
case ConpherenceUpdateActions::JOIN_ROOM:
2728
$needed_capabilities[] = PhabricatorPolicyCapability::CAN_JOIN;
2829
break;
30+
case ConpherenceUpdateActions::NOTIFICATIONS:
31+
$need_participants = true;
32+
break;
33+
case ConpherenceUpdateActions::LOAD:
34+
break;
2935
}
3036
$conpherence = id(new ConpherenceThreadQuery())
3137
->setViewer($user)
3238
->withIDs(array($conpherence_id))
3339
->needFilePHIDs(true)
34-
->needParticipantCache(true)
40+
->needParticipants($need_participants)
3541
->requireCapabilities($needed_capabilities)
3642
->executeOne();
3743

@@ -373,10 +379,9 @@ private function loadAndRenderUpdates(
373379

374380
$need_widget_data = false;
375381
$need_transactions = false;
376-
$need_participant_cache = false;
382+
$need_participant_cache = true;
377383
switch ($action) {
378384
case ConpherenceUpdateActions::METADATA:
379-
$need_participant_cache = true;
380385
$need_transactions = true;
381386
break;
382387
case ConpherenceUpdateActions::LOAD:

src/applications/conpherence/query/ConpherenceThreadQuery.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ protected function loadPage() {
9797
$this->loadParticipantsAndInitHandles($conpherences);
9898
if ($this->needParticipantCache) {
9999
$this->loadCoreHandles($conpherences, 'getRecentParticipantPHIDs');
100-
} else if ($this->needWidgetData) {
100+
}
101+
if ($this->needWidgetData) {
101102
$this->loadCoreHandles($conpherences, 'getParticipantPHIDs');
102103
}
103104
if ($this->needTransactions) {
@@ -244,7 +245,8 @@ private function loadCoreHandles(
244245
->execute();
245246
foreach ($handle_phids as $conpherence_phid => $phids) {
246247
$conpherence = $conpherences[$conpherence_phid];
247-
$conpherence->attachHandles(array_select_keys($handles, $phids));
248+
$conpherence->attachHandles(
249+
$conpherence->getHandles() + array_select_keys($handles, $phids));
248250
}
249251
return $this;
250252
}

0 commit comments

Comments
 (0)