fix(lexicon): switch bool value to non-lazy

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/55864/head
Maxence Lange 2025-10-20 15:28:15 +07:00
parent 4696524c9c
commit edfc339bf5
7 changed files with 31 additions and 56 deletions

@ -49,7 +49,7 @@ class ConfigLexicon implements ILexicon {
type: ValueType::BOOL, type: ValueType::BOOL,
defaultRaw: true, defaultRaw: true,
definition: 'adds share permission to public shares to allow adding them to your Nextcloud (federation)', definition: 'adds share permission to public shares to allow adding them to your Nextcloud (federation)',
lazy: true, lazy: false,
), ),
new Entry( new Entry(
key: self::SHARE_CUSTOM_TOKEN, key: self::SHARE_CUSTOM_TOKEN,
@ -59,7 +59,7 @@ class ConfigLexicon implements ILexicon {
default => false, default => false,
}, },
definition: 'Allow users to customize share URL', 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.', 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'), 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' 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::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_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: true, note: 'set as empty string to disable feature'), 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_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'), 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'),
]; ];

@ -1949,7 +1949,6 @@ return array(
'OC\\Remote\\User' => $baseDir . '/lib/private/Remote/User.php', 'OC\\Remote\\User' => $baseDir . '/lib/private/Remote/User.php',
'OC\\Repair' => $baseDir . '/lib/private/Repair.php', 'OC\\Repair' => $baseDir . '/lib/private/Repair.php',
'OC\\RepairException' => $baseDir . '/lib/private/RepairException.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\\AddBruteForceCleanupJob' => $baseDir . '/lib/private/Repair/AddBruteForceCleanupJob.php',
'OC\\Repair\\AddCleanupDeletedUsersBackgroundJob' => $baseDir . '/lib/private/Repair/AddCleanupDeletedUsersBackgroundJob.php', 'OC\\Repair\\AddCleanupDeletedUsersBackgroundJob' => $baseDir . '/lib/private/Repair/AddCleanupDeletedUsersBackgroundJob.php',
'OC\\Repair\\AddCleanupUpdaterBackupsJob' => $baseDir . '/lib/private/Repair/AddCleanupUpdaterBackupsJob.php', 'OC\\Repair\\AddCleanupUpdaterBackupsJob' => $baseDir . '/lib/private/Repair/AddCleanupUpdaterBackupsJob.php',

@ -1990,7 +1990,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OC\\Remote\\User' => __DIR__ . '/../../..' . '/lib/private/Remote/User.php', 'OC\\Remote\\User' => __DIR__ . '/../../..' . '/lib/private/Remote/User.php',
'OC\\Repair' => __DIR__ . '/../../..' . '/lib/private/Repair.php', 'OC\\Repair' => __DIR__ . '/../../..' . '/lib/private/Repair.php',
'OC\\RepairException' => __DIR__ . '/../../..' . '/lib/private/RepairException.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\\AddBruteForceCleanupJob' => __DIR__ . '/../../..' . '/lib/private/Repair/AddBruteForceCleanupJob.php',
'OC\\Repair\\AddCleanupDeletedUsersBackgroundJob' => __DIR__ . '/../../..' . '/lib/private/Repair/AddCleanupDeletedUsersBackgroundJob.php', 'OC\\Repair\\AddCleanupDeletedUsersBackgroundJob' => __DIR__ . '/../../..' . '/lib/private/Repair/AddCleanupDeletedUsersBackgroundJob.php',
'OC\\Repair\\AddCleanupUpdaterBackupsJob' => __DIR__ . '/../../..' . '/lib/private/Repair/AddCleanupUpdaterBackupsJob.php', 'OC\\Repair\\AddCleanupUpdaterBackupsJob' => __DIR__ . '/../../..' . '/lib/private/Repair/AddCleanupUpdaterBackupsJob.php',

@ -85,15 +85,39 @@ class ConfigManager {
/** /**
* Upgrade stored data in case of changes in the lexicon. * Upgrade stored data in case of changes in the lexicon.
* Heavy process to be executed on core and app upgrade. * Heavy process to be executed on core and app upgrade.
*
* - upgrade UserConfig entries if set as indexed
*/ */
public function updateLexiconEntries(string $appId): void { public function updateLexiconEntries(string $appId): void {
$this->loadConfigServices(); $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); $lexicon = $this->userConfig->getConfigDetailsFromLexicon($appId);
foreach ($lexicon['entries'] as $entry) { foreach ($lexicon['entries'] as $entry) {
// upgrade based on index flag // upgrade based on index flag
$this->userConfig->updateGlobalIndexed($appId, $entry->getKey(), $entry->isFlagged(IUserConfig::FLAG_INDEXED)); $this->userConfig->updateGlobalIndexed($appId, $entry->getKey(), $entry->isFlagged(IUserConfig::FLAG_INDEXED));
// update laziness
$this->userConfig->updateGlobalLazy($appId, $entry->getKey(), $entry->isLazy());
} }
} }

@ -8,7 +8,6 @@
namespace OC; namespace OC;
use OC\DB\ConnectionAdapter; use OC\DB\ConnectionAdapter;
use OC\Repair\AddAppConfigLazyMigration;
use OC\Repair\AddBruteForceCleanupJob; use OC\Repair\AddBruteForceCleanupJob;
use OC\Repair\AddCleanupDeletedUsersBackgroundJob; use OC\Repair\AddCleanupDeletedUsersBackgroundJob;
use OC\Repair\AddCleanupUpdaterBackupsJob; use OC\Repair\AddCleanupUpdaterBackupsJob;
@ -196,7 +195,6 @@ class Repair implements IOutput {
\OCP\Server::get(AddMissingSecretJob::class), \OCP\Server::get(AddMissingSecretJob::class),
\OCP\Server::get(AddRemoveOldTasksBackgroundJob::class), \OCP\Server::get(AddRemoveOldTasksBackgroundJob::class),
\OCP\Server::get(AddMetadataGenerationJob::class), \OCP\Server::get(AddMetadataGenerationJob::class),
\OCP\Server::get(AddAppConfigLazyMigration::class),
\OCP\Server::get(RepairLogoDimension::class), \OCP\Server::get(RepairLogoDimension::class),
\OCP\Server::get(RemoveLegacyDatadirFile::class), \OCP\Server::get(RemoveLegacyDatadirFile::class),
\OCP\Server::get(AddCleanupDeletedUsersBackgroundJob::class), \OCP\Server::get(AddCleanupDeletedUsersBackgroundJob::class),

@ -1,45 +0,0 @@
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\Repair;
use OCP\IAppConfig;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
use Psr\Log\LoggerInterface;
class AddAppConfigLazyMigration implements IRepairStep {
/**
* Just add config values that needs to be migrated to lazy loading
*/
private static array $lazyAppConfig = [
'core' => [
'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');
}
}

@ -9,7 +9,7 @@
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patch level // between betas, final and RCs. This is _not_ the public version number. Reset minor/patch level
// when updating major/minor version number. // when updating major/minor version number.
$OC_Version = [33, 0, 0, 1]; $OC_Version = [33, 0, 0, 2];
// The human-readable string // The human-readable string
$OC_VersionString = '33.0.0 dev'; $OC_VersionString = '33.0.0 dev';