aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppConfig.php8
-rw-r--r--lib/private/Config/UserConfig.php13
2 files changed, 20 insertions, 1 deletions
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php
index a8a6f689ffa..0a9c1ef98c8 100644
--- a/lib/private/AppConfig.php
+++ b/lib/private/AppConfig.php
@@ -969,7 +969,7 @@ class AppConfig implements IAppConfig {
if ($lazy === $this->isLazy($app, $key)) {
return false;
}
- } catch (AppConfigUnknownKeyException $e) {
+ } catch (AppConfigUnknownKeyException) {
return false;
}
@@ -1605,6 +1605,12 @@ class AppConfig implements IAppConfig {
$this->logger->notice('App config key ' . $app . '/' . $key . ' is set as deprecated.');
}
+ if ($lazy && isset($this->fastCache[$app][$key])) {
+ // while the Lexicon indicate that the config value is expected Lazy, we could
+ // have a previous entry still in fast cache. Updating Laziness.
+ $this->updateLazy($app, $key, true);
+ }
+
return true;
}
diff --git a/lib/private/Config/UserConfig.php b/lib/private/Config/UserConfig.php
index 77a86a5e1c7..22588d5394d 100644
--- a/lib/private/Config/UserConfig.php
+++ b/lib/private/Config/UserConfig.php
@@ -1865,6 +1865,19 @@ class UserConfig implements IUserConfig {
$this->logger->notice('User config key ' . $app . '/' . $key . ' is set as deprecated.');
}
+ // There should be no downside to load all config values if search for
+ // a lazy config value while fast value are still not loaded.
+ if ($lazy && !($this->fastLoaded[$userId] ?? false)) {
+ $this->loadConfigAll($userId);
+ }
+
+ // while the Lexicon indicate that the config value is expected Lazy, we could
+ // have a previous entry still in fast cache. Updating Laziness for all users.
+ if ($lazy && isset($this->fastCache[$userId][$app][$key])) {
+ $this->updateGlobalLazy($app, $key, true);
+ }
+
+ // TODO: remove this feature before 32 if https://github.com/nextcloud/server/issues/51804 is implemented
$enforcedValue = $this->config->getSystemValue('lexicon.default.userconfig.enforced', [])[$app][$key] ?? false;
if (!$enforcedValue && $this->hasKey($userId, $app, $key, $lazy)) {
// if key exists there should be no need to extract default