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

Conpherence - improve performance by handling dropdowns (notifications, threads) as standard response data

Summary: Ref T7708. Rather than invoking the general client -> server dropdown refresh path, return the data with the various conpherence requests and update the dropdowns that way. Saves 2 client -> server requests per conpherence action.

Test Plan: loaded up /conpherence/ and noted message count deduct correctly. clicked specific message and noted message count deduct successfully. did same two tests via durable column and again saw message counts deduct successfully.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7708

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

+79 -42
+26 -26
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => 'ca3f6a60', 11 - 'core.pkg.js' => 'dcd6c8e3', 11 + 'core.pkg.js' => '919c56b5', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => 'bb338e4b', 14 14 'differential.pkg.js' => '895b8d62', ··· 341 341 'rsrc/image/texture/table_header_hover.png' => '038ec3b9', 342 342 'rsrc/image/texture/table_header_tall.png' => 'd56b434f', 343 343 'rsrc/js/application/aphlict/Aphlict.js' => '5359e785', 344 - 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '0323afdd', 344 + 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '995ad707', 345 345 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'b1a59974', 346 346 'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761', 347 347 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', 348 348 'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de', 349 - 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '7a608e21', 349 + 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '9e507b59', 350 350 'rsrc/js/application/conpherence/behavior-drag-and-drop-photo.js' => 'cf86d16a', 351 351 'rsrc/js/application/conpherence/behavior-durable-column.js' => '657c2b50', 352 352 'rsrc/js/application/conpherence/behavior-menu.js' => '804b0773', ··· 513 513 'conpherence-menu-css' => 'f389e048', 514 514 'conpherence-message-pane-css' => '3150e2a2', 515 515 'conpherence-notification-css' => 'd208f806', 516 - 'conpherence-thread-manager' => '7a608e21', 516 + 'conpherence-thread-manager' => '9e507b59', 517 517 'conpherence-transaction-css' => '25138b7f', 518 518 'conpherence-update-css' => '1099a660', 519 519 'conpherence-widget-pane-css' => '2af42ebe', ··· 541 541 'inline-comment-summary-css' => 'eb5f8e8c', 542 542 'javelin-aphlict' => '5359e785', 543 543 'javelin-behavior' => '61cbc29a', 544 - 'javelin-behavior-aphlict-dropdown' => '0323afdd', 544 + 'javelin-behavior-aphlict-dropdown' => '995ad707', 545 545 'javelin-behavior-aphlict-listen' => 'b1a59974', 546 546 'javelin-behavior-aphlict-status' => 'ea681761', 547 547 'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884', ··· 836 836 '029a133d' => array( 837 837 'aphront-dialog-view-css', 838 838 ), 839 - '0323afdd' => array( 840 - 'javelin-behavior', 841 - 'javelin-request', 842 - 'javelin-stratcom', 843 - 'javelin-vector', 844 - 'javelin-dom', 845 - 'javelin-uri', 846 - 'javelin-behavior-device', 847 - 'phabricator-title', 848 - ), 849 839 '048330fa' => array( 850 840 'javelin-behavior', 851 841 'javelin-typeahead-ondemand-source', ··· 1387 1377 'javelin-behavior', 1388 1378 'javelin-quicksand', 1389 1379 ), 1390 - '7a608e21' => array( 1391 - 'javelin-dom', 1392 - 'javelin-util', 1393 - 'javelin-stratcom', 1394 - 'javelin-install', 1395 - 'javelin-aphlict', 1396 - 'javelin-workflow', 1397 - 'javelin-router', 1398 - 'javelin-behavior-device', 1399 - 'javelin-vector', 1400 - ), 1401 1380 '7a68dda3' => array( 1402 1381 'owners-path-editor', 1403 1382 'javelin-behavior', ··· 1589 1568 'javelin-dom', 1590 1569 'javelin-reactor-dom', 1591 1570 ), 1571 + '995ad707' => array( 1572 + 'javelin-behavior', 1573 + 'javelin-request', 1574 + 'javelin-stratcom', 1575 + 'javelin-vector', 1576 + 'javelin-dom', 1577 + 'javelin-uri', 1578 + 'javelin-behavior-device', 1579 + 'phabricator-title', 1580 + ), 1592 1581 '9a340b3d' => array( 1593 1582 'javelin-behavior', 1594 1583 'javelin-dom', ··· 1597 1586 'phuix-action-list-view', 1598 1587 'phuix-action-view', 1599 1588 'javelin-workflow', 1589 + ), 1590 + '9e507b59' => array( 1591 + 'javelin-dom', 1592 + 'javelin-util', 1593 + 'javelin-stratcom', 1594 + 'javelin-install', 1595 + 'javelin-aphlict', 1596 + 'javelin-workflow', 1597 + 'javelin-router', 1598 + 'javelin-behavior-device', 1599 + 'javelin-vector', 1600 1600 ), 1601 1601 '9f36c42d' => array( 1602 1602 'javelin-behavior',
+7
src/applications/conpherence/controller/ConpherenceColumnViewController.php
··· 88 88 PhabricatorPolicyCapability::CAN_EDIT); 89 89 } 90 90 91 + $dropdown_query = id(new AphlictDropdownDataQuery()) 92 + ->setViewer($user); 93 + $dropdown_query->execute(); 91 94 $response = array( 92 95 'content' => hsprintf('%s', $durable_column), 93 96 'threadID' => $conpherence_id, 94 97 'threadPHID' => $conpherence_phid, 95 98 'latestTransactionID' => $latest_transaction_id, 96 99 'canEdit' => $can_edit, 100 + 'aphlictDropdownData' => array( 101 + $dropdown_query->getNotificationData(), 102 + $dropdown_query->getConpherenceData(), 103 + ), 97 104 ); 98 105 99 106 return id(new AphrontAjaxResponse())->setContent($response);
+7 -1
src/applications/conpherence/controller/ConpherenceUpdateController.php
··· 543 543 break; 544 544 } 545 545 } 546 - 547 546 $data = $conpherence->getDisplayData($user); 547 + $dropdown_query = id(new AphlictDropdownDataQuery()) 548 + ->setViewer($user); 549 + $dropdown_query->execute(); 548 550 $content = array( 549 551 'non_update' => $non_update, 550 552 'transactions' => hsprintf('%s', $rendered_transactions), ··· 555 557 'header' => $header, 556 558 'file_widget' => $file_widget, 557 559 'people_widget' => $people_widget, 560 + 'aphlictDropdownData' => array( 561 + $dropdown_query->getNotificationData(), 562 + $dropdown_query->getConpherenceData(), 563 + ), 558 564 ); 559 565 560 566 return $content;
+7
src/applications/conpherence/controller/ConpherenceViewController.php
··· 94 94 $content['title'] = $title = $d_data['title']; 95 95 96 96 if ($request->isAjax()) { 97 + $dropdown_query = id(new AphlictDropdownDataQuery()) 98 + ->setViewer($user); 99 + $dropdown_query->execute(); 97 100 $content['threadID'] = $conpherence->getID(); 98 101 $content['threadPHID'] = $conpherence->getPHID(); 99 102 $content['latestTransactionID'] = $data['latest_transaction_id']; ··· 101 104 $user, 102 105 $conpherence, 103 106 PhabricatorPolicyCapability::CAN_EDIT); 107 + $content['aphlictDropdownData'] = array( 108 + $dropdown_query->getNotificationData(), 109 + $dropdown_query->getConpherenceData(), 110 + ); 104 111 return id(new AphrontAjaxResponse())->setContent($content); 105 112 } 106 113
+24 -13
webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js
··· 93 93 if (!data.fromServer) { 94 94 return; 95 95 } 96 - var updated = false; 97 96 var new_data = data.newResponse.aphlictDropdownData; 98 - for (var ii = 0; ii < new_data.length; ii++) { 99 - if (new_data[ii].countType != config.countType) { 100 - continue; 101 - } 102 - if (!new_data[ii].isInstalled) { 103 - continue; 104 - } 105 - updated = true; 106 - _updateCount(parseInt(new_data[ii].count)); 97 + update_counts(new_data); 98 + }); 99 + 100 + JX.Stratcom.listen( 101 + 'conpherence-redraw-aphlict', 102 + null, 103 + function (e) { 104 + update_counts(e.getData()); 105 + }); 106 + 107 + function update_counts(new_data) { 108 + var updated = false; 109 + for (var ii = 0; ii < new_data.length; ii++) { 110 + if (new_data[ii].countType != config.countType) { 111 + continue; 107 112 } 108 - if (updated) { 109 - dirty = true; 113 + if (!new_data[ii].isInstalled) { 114 + continue; 110 115 } 111 - }); 116 + updated = true; 117 + _updateCount(parseInt(new_data[ii].count)); 118 + } 119 + if (updated) { 120 + dirty = true; 121 + } 122 + } 112 123 113 124 function set_visible(menu, icon) { 114 125 if (menu) {
+8 -2
webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js
··· 205 205 _markUpdated: function(r) { 206 206 this._updating.knownID = r.latest_transaction_id; 207 207 this._latestTransactionID = r.latest_transaction_id; 208 - JX.Stratcom.invoke('notification-panel-update', null, {}); 208 + JX.Stratcom.invoke( 209 + 'conpherence-redraw-aphlict', 210 + null, 211 + r.aphlictDropdownData); 209 212 }, 210 213 211 214 _updateThread: function() { ··· 298 301 this._latestTransactionID = r.latestTransactionID; 299 302 this._canEditLoadedThread = r.canEdit; 300 303 301 - JX.Stratcom.invoke('notification-panel-update', null, {}); 304 + JX.Stratcom.invoke( 305 + 'conpherence-redraw-aphlict', 306 + null, 307 + r.aphlictDropdownData); 302 308 303 309 this._didLoadThreadCallback(r); 304 310