Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(app): Do not clear unused cache key #38524

Merged
merged 1 commit into from Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/private/App/AppManager.php
Expand Up @@ -673,8 +673,6 @@ public function getAppWebPath(string $appId): string {
* Clear the cached list of apps when enabling/disabling an app
*/
public function clearAppsCache() {
$settingsMemCache = $this->memCacheFactory->createDistributed('settings');
$settingsMemCache->clear('listApps');
$this->appInfos = [];
}

Expand Down
10 changes: 0 additions & 10 deletions tests/lib/App/AppManagerTest.php
Expand Up @@ -133,14 +133,7 @@ protected function setUp(): void {
);
}

protected function expectClearCache() {
$this->cache->expects($this->once())
->method('clear')
->with('listApps');
}

public function testEnableApp() {
$this->expectClearCache();
// making sure "files_trashbin" is disabled
if ($this->manager->isEnabledForUser('files_trashbin')) {
$this->manager->disableApp('files_trashbin');
Expand All @@ -151,7 +144,6 @@ public function testEnableApp() {
}

public function testDisableApp() {
$this->expectClearCache();
$this->eventDispatcher->expects($this->once())->method('dispatchTyped')->with(new AppDisableEvent('files_trashbin'));
$this->manager->disableApp('files_trashbin');
$this->assertEquals('no', $this->appConfig->getValue('files_trashbin', 'enabled', 'no'));
Expand Down Expand Up @@ -180,7 +172,6 @@ public function testEnableAppForGroups() {
->willReturn('group2');

$groups = [$group1, $group2];
$this->expectClearCache();

/** @var AppManager|MockObject $manager */
$manager = $this->getMockBuilder(AppManager::class)
Expand Down Expand Up @@ -229,7 +220,6 @@ public function testEnableAppForGroupsAllowedTypes(array $appInfo) {
->willReturn('group2');

$groups = [$group1, $group2];
$this->expectClearCache();

/** @var AppManager|MockObject $manager */
$manager = $this->getMockBuilder(AppManager::class)
Expand Down