1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

After toggling DarkConsole, force a user settings cache fill

Summary:
Ref T10078. Currently, you toggle DarkConsole and then load a page, but on the load we have to refill your settings cache since toggling DarkConsole dirtied it.

This is fine, except that it makes it harder to understand what's going on with queries on a page. Just force it to reload right away instead.

Test Plan: Toggled DarkConsole, reloaded page, no longer saw settings toggle-related cache fill.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10078

Differential Revision: https://secure.phabricator.com/D16044
This commit is contained in:
epriestley 2016-06-05 06:56:02 -07:00
parent 5ba7938d54
commit aa4ba0fa92

View file

@ -59,6 +59,17 @@ final class DarkConsoleController extends PhabricatorController {
$xactions = array();
$xactions[] = $preferences->newTransaction($key, $value);
$editor->applyTransactions($preferences, $xactions);
// Reload the user to regenerate their preferences cache. If we don't
// do this, the "Services" tab gets misleadingly spammed up with cache
// fills that are only filling because you toggled the console or switched
// tabs. This makes it harder to see what's really going on, so just force
// a cache regeneration here.
id(new PhabricatorPeopleQuery())
->setViewer($viewer)
->withPHIDs(array($viewer->getPHID()))
->needUserSettings(true)
->execute();
}
}