diff --git a/core/AppInfo/ConfigLexicon.php b/core/AppInfo/ConfigLexicon.php index 5faa0e4a296..06a0ec49e51 100644 --- a/core/AppInfo/ConfigLexicon.php +++ b/core/AppInfo/ConfigLexicon.php @@ -49,7 +49,7 @@ class ConfigLexicon implements ILexicon { type: ValueType::BOOL, defaultRaw: true, definition: 'adds share permission to public shares to allow adding them to your Nextcloud (federation)', - lazy: true, + lazy: false, ), new Entry( key: self::SHARE_CUSTOM_TOKEN, @@ -59,7 +59,7 @@ class ConfigLexicon implements ILexicon { default => false, }, definition: 'Allow users to customize share URL', - lazy: true, + lazy: false, note: 'Shares with guessable tokens may be accessed easily. Shares with custom tokens will continue to be accessible after this setting has been disabled.', ), new Entry(self::SHARE_LINK_PASSWORD_DEFAULT, ValueType::BOOL, false, 'Ask for a password when sharing document by default'), @@ -91,8 +91,8 @@ class ConfigLexicon implements ILexicon { definition: 'Enforce expiration date for shares via link or mail' ), new Entry(self::LASTCRON_TIMESTAMP, ValueType::INT, 0, 'timestamp of last cron execution'), - new Entry(self::OCM_DISCOVERY_ENABLED, ValueType::BOOL, true, 'enable/disable OCM', lazy: true), - new Entry(self::OCM_INVITE_ACCEPT_DIALOG, ValueType::STRING, '', 'route to local invite accept dialog', lazy: true, note: 'set as empty string to disable feature'), + new Entry(self::OCM_DISCOVERY_ENABLED, ValueType::BOOL, true, 'enable/disable OCM', lazy: false), + new Entry(self::OCM_INVITE_ACCEPT_DIALOG, ValueType::STRING, '', 'route to local invite accept dialog', lazy: false, note: 'set as empty string to disable feature'), new Entry(self::UNIFIED_SEARCH_MIN_SEARCH_LENGTH, ValueType::INT, 1, 'Minimum search length to trigger the request', lazy: false, rename: 'unified-search.min-search-length'), new Entry(self::UNIFIED_SEARCH_MAX_RESULTS_PER_REQUEST, ValueType::INT, 25, 'Maximum results returned per search request', lazy: false, rename: 'unified-search.max-results-per-request'), ]; diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 1dfbd6cc06d..190929266b9 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -1946,7 +1946,6 @@ return array( 'OC\\Remote\\User' => $baseDir . '/lib/private/Remote/User.php', 'OC\\Repair' => $baseDir . '/lib/private/Repair.php', 'OC\\RepairException' => $baseDir . '/lib/private/RepairException.php', - 'OC\\Repair\\AddAppConfigLazyMigration' => $baseDir . '/lib/private/Repair/AddAppConfigLazyMigration.php', 'OC\\Repair\\AddBruteForceCleanupJob' => $baseDir . '/lib/private/Repair/AddBruteForceCleanupJob.php', 'OC\\Repair\\AddCleanupDeletedUsersBackgroundJob' => $baseDir . '/lib/private/Repair/AddCleanupDeletedUsersBackgroundJob.php', 'OC\\Repair\\AddCleanupUpdaterBackupsJob' => $baseDir . '/lib/private/Repair/AddCleanupUpdaterBackupsJob.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 4666d787063..ee51d218b61 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -1987,7 +1987,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OC\\Remote\\User' => __DIR__ . '/../../..' . '/lib/private/Remote/User.php', 'OC\\Repair' => __DIR__ . '/../../..' . '/lib/private/Repair.php', 'OC\\RepairException' => __DIR__ . '/../../..' . '/lib/private/RepairException.php', - 'OC\\Repair\\AddAppConfigLazyMigration' => __DIR__ . '/../../..' . '/lib/private/Repair/AddAppConfigLazyMigration.php', 'OC\\Repair\\AddBruteForceCleanupJob' => __DIR__ . '/../../..' . '/lib/private/Repair/AddBruteForceCleanupJob.php', 'OC\\Repair\\AddCleanupDeletedUsersBackgroundJob' => __DIR__ . '/../../..' . '/lib/private/Repair/AddCleanupDeletedUsersBackgroundJob.php', 'OC\\Repair\\AddCleanupUpdaterBackupsJob' => __DIR__ . '/../../..' . '/lib/private/Repair/AddCleanupUpdaterBackupsJob.php', diff --git a/lib/private/Config/ConfigManager.php b/lib/private/Config/ConfigManager.php index f5ef024578c..302b7b3b725 100644 --- a/lib/private/Config/ConfigManager.php +++ b/lib/private/Config/ConfigManager.php @@ -85,15 +85,39 @@ class ConfigManager { /** * Upgrade stored data in case of changes in the lexicon. * Heavy process to be executed on core and app upgrade. - * - * - upgrade UserConfig entries if set as indexed */ public function updateLexiconEntries(string $appId): void { $this->loadConfigServices(); + $this->updateLexiconAppConfigEntries($appId); + $this->updateLexiconUserConfigEntries($appId); + } + + /** + * Apply modification on the lexicon to the stored app config values: + * + * - Upgrade AppConfig entries if set as lazy/not-lazy + */ + private function updateLexiconAppConfigEntries(string $appId): void { + $lexicon = $this->appConfig->getConfigDetailsFromLexicon($appId); + foreach ($lexicon['entries'] as $entry) { + // update laziness + $this->appConfig->updateLazy($appId, $entry->getKey(), $entry->isLazy()); + } + } + + /** + * Apply modification on the lexicon to the stored user preferences values: + * + * - Upgrade UserConfig entries if set as indexed/not-indexed + * - Upgrade UserConfig entries if set as lazy/not-lazy + */ + private function updateLexiconUserConfigEntries(string $appId): void { $lexicon = $this->userConfig->getConfigDetailsFromLexicon($appId); foreach ($lexicon['entries'] as $entry) { // upgrade based on index flag $this->userConfig->updateGlobalIndexed($appId, $entry->getKey(), $entry->isFlagged(IUserConfig::FLAG_INDEXED)); + // update laziness + $this->userConfig->updateGlobalLazy($appId, $entry->getKey(), $entry->isLazy()); } } diff --git a/lib/private/Repair.php b/lib/private/Repair.php index 583604515af..c32139f5bf0 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -8,7 +8,6 @@ namespace OC; use OC\DB\ConnectionAdapter; -use OC\Repair\AddAppConfigLazyMigration; use OC\Repair\AddBruteForceCleanupJob; use OC\Repair\AddCleanupDeletedUsersBackgroundJob; use OC\Repair\AddCleanupUpdaterBackupsJob; @@ -194,7 +193,6 @@ class Repair implements IOutput { \OCP\Server::get(AddMissingSecretJob::class), \OCP\Server::get(AddRemoveOldTasksBackgroundJob::class), \OCP\Server::get(AddMetadataGenerationJob::class), - \OCP\Server::get(AddAppConfigLazyMigration::class), \OCP\Server::get(RepairLogoDimension::class), \OCP\Server::get(RemoveLegacyDatadirFile::class), \OCP\Server::get(AddCleanupDeletedUsersBackgroundJob::class), diff --git a/lib/private/Repair/AddAppConfigLazyMigration.php b/lib/private/Repair/AddAppConfigLazyMigration.php deleted file mode 100644 index 7ae83e87669..00000000000 --- a/lib/private/Repair/AddAppConfigLazyMigration.php +++ /dev/null @@ -1,45 +0,0 @@ - [ - 'oc.integritycheck.checker', - ], - ]; - - public function __construct( - private IAppConfig $appConfig, - private LoggerInterface $logger, - ) { - } - - public function getName() { - return 'migrate lazy config values'; - } - - public function run(IOutput $output) { - $c = 0; - foreach (self::$lazyAppConfig as $appId => $configKeys) { - foreach ($configKeys as $configKey) { - $c += (int)$this->appConfig->updateLazy($appId, $configKey, true); - } - } - - $this->logger->notice('core/BackgroundJobs/AppConfigLazyMigration: ' . $c . ' config values updated'); - } -}