diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2025-05-07 14:06:56 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2025-05-07 14:08:10 -0100 |
commit | 62a82ae702d04aa2a68c9bffc2ce9b92965df8cd (patch) | |
tree | 77ee307f8a971f2cc621d73d54a9e184945bdc37 /lib/private | |
parent | 0dc971189badaf050fa5048e391c70fb15171b6f (diff) | |
download | nextcloud-server-fix/noid/lexicon-update-lazy-status.tar.gz nextcloud-server-fix/noid/lexicon-update-lazy-status.zip |
feat(appconfig+userconfig): lexicon update lazy statusfix/noid/lexicon-update-lazy-status
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/AppConfig.php | 8 | ||||
-rw-r--r-- | lib/private/Config/UserConfig.php | 13 |
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 |