mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-12 06:48:31 +01:00
Conpherence - improve durable column performance when sending updates
Summary: Ref T7708. We were generating things like the files widget when users sent a comment. This is unnecessary if we are in minimal display mode. This saves us fetching some data + rendering. Test Plan: sent messages successfully in durable column and full conpherence view Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7708 Differential Revision: https://secure.phabricator.com/D12760
This commit is contained in:
parent
f7c14736c1
commit
ef3b62564e
1 changed files with 43 additions and 38 deletions
|
@ -453,6 +453,7 @@ final class ConpherenceUpdateController
|
||||||
$conpherence_id,
|
$conpherence_id,
|
||||||
$latest_transaction_id) {
|
$latest_transaction_id) {
|
||||||
|
|
||||||
|
$minimal_display = $this->getRequest()->getExists('minimal_display');
|
||||||
$need_widget_data = false;
|
$need_widget_data = false;
|
||||||
$need_transactions = false;
|
$need_transactions = false;
|
||||||
$need_participant_cache = true;
|
$need_participant_cache = true;
|
||||||
|
@ -464,7 +465,7 @@ final class ConpherenceUpdateController
|
||||||
case ConpherenceUpdateActions::MESSAGE:
|
case ConpherenceUpdateActions::MESSAGE:
|
||||||
case ConpherenceUpdateActions::ADD_PERSON:
|
case ConpherenceUpdateActions::ADD_PERSON:
|
||||||
$need_transactions = true;
|
$need_transactions = true;
|
||||||
$need_widget_data = true;
|
$need_widget_data = !$minimal_display;
|
||||||
break;
|
break;
|
||||||
case ConpherenceUpdateActions::REMOVE_PERSON:
|
case ConpherenceUpdateActions::REMOVE_PERSON:
|
||||||
case ConpherenceUpdateActions::NOTIFICATIONS:
|
case ConpherenceUpdateActions::NOTIFICATIONS:
|
||||||
|
@ -488,7 +489,7 @@ final class ConpherenceUpdateController
|
||||||
$data = ConpherenceTransactionRenderer::renderTransactions(
|
$data = ConpherenceTransactionRenderer::renderTransactions(
|
||||||
$user,
|
$user,
|
||||||
$conpherence,
|
$conpherence,
|
||||||
!$this->getRequest()->getExists('minimal_display'));
|
!$minimal_display);
|
||||||
$participant_obj = $conpherence->getParticipant($user->getPHID());
|
$participant_obj = $conpherence->getParticipant($user->getPHID());
|
||||||
$participant_obj->markUpToDate($conpherence, $data['latest_transaction']);
|
$participant_obj->markUpToDate($conpherence, $data['latest_transaction']);
|
||||||
} else if ($need_transactions) {
|
} else if ($need_transactions) {
|
||||||
|
@ -505,51 +506,55 @@ final class ConpherenceUpdateController
|
||||||
$header = null;
|
$header = null;
|
||||||
$people_widget = null;
|
$people_widget = null;
|
||||||
$file_widget = null;
|
$file_widget = null;
|
||||||
|
if (!$minimal_display) {
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case ConpherenceUpdateActions::METADATA:
|
case ConpherenceUpdateActions::METADATA:
|
||||||
$policy_objects = id(new PhabricatorPolicyQuery())
|
$policy_objects = id(new PhabricatorPolicyQuery())
|
||||||
->setViewer($user)
|
->setViewer($user)
|
||||||
->setObject($conpherence)
|
->setObject($conpherence)
|
||||||
->execute();
|
->execute();
|
||||||
$header = $this->buildHeaderPaneContent($conpherence, $policy_objects);
|
$header = $this->buildHeaderPaneContent(
|
||||||
|
$conpherence,
|
||||||
|
$policy_objects);
|
||||||
|
$header = hsprintf('%s', $header);
|
||||||
$nav_item = id(new ConpherenceThreadListView())
|
$nav_item = id(new ConpherenceThreadListView())
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->setBaseURI($this->getApplicationURI())
|
->setBaseURI($this->getApplicationURI())
|
||||||
->renderSingleThread($conpherence);
|
->renderSingleThread($conpherence);
|
||||||
|
$nav_item = hsprintf('%s', $nav_item);
|
||||||
break;
|
break;
|
||||||
case ConpherenceUpdateActions::MESSAGE:
|
case ConpherenceUpdateActions::MESSAGE:
|
||||||
$file_widget = id(new ConpherenceFileWidgetView())
|
$file_widget = id(new ConpherenceFileWidgetView())
|
||||||
->setUser($this->getRequest()->getUser())
|
->setUser($this->getRequest()->getUser())
|
||||||
->setConpherence($conpherence)
|
->setConpherence($conpherence)
|
||||||
->setUpdateURI($widget_uri);
|
->setUpdateURI($widget_uri);
|
||||||
|
$file_widget = $file_widget->render();
|
||||||
break;
|
break;
|
||||||
case ConpherenceUpdateActions::ADD_PERSON:
|
case ConpherenceUpdateActions::ADD_PERSON:
|
||||||
$people_widget = id(new ConpherencePeopleWidgetView())
|
$people_widget = id(new ConpherencePeopleWidgetView())
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->setConpherence($conpherence)
|
->setConpherence($conpherence)
|
||||||
->setUpdateURI($widget_uri);
|
->setUpdateURI($widget_uri);
|
||||||
|
$people_widget = $people_widget->render();
|
||||||
break;
|
break;
|
||||||
case ConpherenceUpdateActions::REMOVE_PERSON:
|
case ConpherenceUpdateActions::REMOVE_PERSON:
|
||||||
case ConpherenceUpdateActions::NOTIFICATIONS:
|
case ConpherenceUpdateActions::NOTIFICATIONS:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$people_html = null;
|
|
||||||
if ($people_widget) {
|
|
||||||
$people_html = hsprintf('%s', $people_widget->render());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $conpherence->getDisplayData($user);
|
$data = $conpherence->getDisplayData($user);
|
||||||
$content = array(
|
$content = array(
|
||||||
'non_update' => $non_update,
|
'non_update' => $non_update,
|
||||||
'transactions' => hsprintf('%s', $rendered_transactions),
|
'transactions' => hsprintf('%s', $rendered_transactions),
|
||||||
'conpherence_title' => (string) $data['title'],
|
'conpherence_title' => (string) $data['title'],
|
||||||
'latest_transaction_id' => $new_latest_transaction_id,
|
'latest_transaction_id' => $new_latest_transaction_id,
|
||||||
'nav_item' => hsprintf('%s', $nav_item),
|
'nav_item' => $nav_item,
|
||||||
'conpherence_phid' => $conpherence->getPHID(),
|
'conpherence_phid' => $conpherence->getPHID(),
|
||||||
'header' => hsprintf('%s', $header),
|
'header' => $header,
|
||||||
'file_widget' => $file_widget ? $file_widget->render() : null,
|
'file_widget' => $file_widget,
|
||||||
'people_widget' => $people_html,
|
'people_widget' => $people_widget,
|
||||||
);
|
);
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
|
|
Loading…
Add table
Reference in a new issue