Skip to content

Commit a7e7ca5

Browse files
committed
fix(lexicon): switch bool value to non-lazy
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent 78865e3 commit a7e7ca5

File tree

7 files changed

+31
-56
lines changed

7 files changed

+31
-56
lines changed

core/AppInfo/ConfigLexicon.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function getAppConfigs(): array {
4949
type: ValueType::BOOL,
5050
defaultRaw: true,
5151
definition: 'adds share permission to public shares to allow adding them to your Nextcloud (federation)',
52-
lazy: true,
52+
lazy: false,
5353
),
5454
new Entry(
5555
key: self::SHARE_CUSTOM_TOKEN,
@@ -59,7 +59,7 @@ public function getAppConfigs(): array {
5959
default => false,
6060
},
6161
definition: 'Allow users to customize share URL',
62-
lazy: true,
62+
lazy: false,
6363
note: 'Shares with guessable tokens may be accessed easily. Shares with custom tokens will continue to be accessible after this setting has been disabled.',
6464
),
6565
new Entry(self::SHARE_LINK_PASSWORD_DEFAULT, ValueType::BOOL, false, 'Ask for a password when sharing document by default'),
@@ -91,8 +91,8 @@ public function getAppConfigs(): array {
9191
definition: 'Enforce expiration date for shares via link or mail'
9292
),
9393
new Entry(self::LASTCRON_TIMESTAMP, ValueType::INT, 0, 'timestamp of last cron execution'),
94-
new Entry(self::OCM_DISCOVERY_ENABLED, ValueType::BOOL, true, 'enable/disable OCM', lazy: true),
95-
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'),
94+
new Entry(self::OCM_DISCOVERY_ENABLED, ValueType::BOOL, true, 'enable/disable OCM', lazy: false),
95+
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'),
9696
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'),
9797
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'),
9898
];

lib/composer/composer/autoload_classmap.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1948,7 +1948,6 @@
19481948
'OC\\Remote\\User' => $baseDir . '/lib/private/Remote/User.php',
19491949
'OC\\Repair' => $baseDir . '/lib/private/Repair.php',
19501950
'OC\\RepairException' => $baseDir . '/lib/private/RepairException.php',
1951-
'OC\\Repair\\AddAppConfigLazyMigration' => $baseDir . '/lib/private/Repair/AddAppConfigLazyMigration.php',
19521951
'OC\\Repair\\AddBruteForceCleanupJob' => $baseDir . '/lib/private/Repair/AddBruteForceCleanupJob.php',
19531952
'OC\\Repair\\AddCleanupDeletedUsersBackgroundJob' => $baseDir . '/lib/private/Repair/AddCleanupDeletedUsersBackgroundJob.php',
19541953
'OC\\Repair\\AddCleanupUpdaterBackupsJob' => $baseDir . '/lib/private/Repair/AddCleanupUpdaterBackupsJob.php',

lib/composer/composer/autoload_static.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1989,7 +1989,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
19891989
'OC\\Remote\\User' => __DIR__ . '/../../..' . '/lib/private/Remote/User.php',
19901990
'OC\\Repair' => __DIR__ . '/../../..' . '/lib/private/Repair.php',
19911991
'OC\\RepairException' => __DIR__ . '/../../..' . '/lib/private/RepairException.php',
1992-
'OC\\Repair\\AddAppConfigLazyMigration' => __DIR__ . '/../../..' . '/lib/private/Repair/AddAppConfigLazyMigration.php',
19931992
'OC\\Repair\\AddBruteForceCleanupJob' => __DIR__ . '/../../..' . '/lib/private/Repair/AddBruteForceCleanupJob.php',
19941993
'OC\\Repair\\AddCleanupDeletedUsersBackgroundJob' => __DIR__ . '/../../..' . '/lib/private/Repair/AddCleanupDeletedUsersBackgroundJob.php',
19951994
'OC\\Repair\\AddCleanupUpdaterBackupsJob' => __DIR__ . '/../../..' . '/lib/private/Repair/AddCleanupUpdaterBackupsJob.php',

lib/private/Config/ConfigManager.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,39 @@ public function migrateConfigLexiconKeys(?string $appId = null): void {
8585
/**
8686
* Upgrade stored data in case of changes in the lexicon.
8787
* Heavy process to be executed on core and app upgrade.
88-
*
89-
* - upgrade UserConfig entries if set as indexed
9088
*/
9189
public function updateLexiconEntries(string $appId): void {
9290
$this->loadConfigServices();
91+
$this->updateLexiconAppConfigEntries($appId);
92+
$this->updateLexiconUserConfigEntries($appId);
93+
}
94+
95+
/**
96+
* Apply modification on the lexicon to the stored app config values:
97+
*
98+
* - Upgrade AppConfig entries if set as lazy/not-lazy
99+
*/
100+
private function updateLexiconAppConfigEntries(string $appId): void {
101+
$lexicon = $this->appConfig->getConfigDetailsFromLexicon($appId);
102+
foreach ($lexicon['entries'] as $entry) {
103+
// update laziness
104+
$this->appConfig->updateLazy($appId, $entry->getKey(), $entry->isLazy());
105+
}
106+
}
107+
108+
/**
109+
* Apply modification on the lexicon to the stored user preferences values:
110+
*
111+
* - Upgrade UserConfig entries if set as indexed/not-indexed
112+
* - Upgrade UserConfig entries if set as lazy/not-lazy
113+
*/
114+
private function updateLexiconUserConfigEntries(string $appId): void {
93115
$lexicon = $this->userConfig->getConfigDetailsFromLexicon($appId);
94116
foreach ($lexicon['entries'] as $entry) {
95117
// upgrade based on index flag
96118
$this->userConfig->updateGlobalIndexed($appId, $entry->getKey(), $entry->isFlagged(IUserConfig::FLAG_INDEXED));
119+
// update laziness
120+
$this->userConfig->updateGlobalLazy($appId, $entry->getKey(), $entry->isLazy());
97121
}
98122
}
99123

lib/private/Repair.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
namespace OC;
99

1010
use OC\DB\ConnectionAdapter;
11-
use OC\Repair\AddAppConfigLazyMigration;
1211
use OC\Repair\AddBruteForceCleanupJob;
1312
use OC\Repair\AddCleanupDeletedUsersBackgroundJob;
1413
use OC\Repair\AddCleanupUpdaterBackupsJob;
@@ -195,7 +194,6 @@ public static function getRepairSteps(): array {
195194
\OCP\Server::get(AddMissingSecretJob::class),
196195
\OCP\Server::get(AddRemoveOldTasksBackgroundJob::class),
197196
\OCP\Server::get(AddMetadataGenerationJob::class),
198-
\OCP\Server::get(AddAppConfigLazyMigration::class),
199197
\OCP\Server::get(RepairLogoDimension::class),
200198
\OCP\Server::get(RemoveLegacyDatadirFile::class),
201199
\OCP\Server::get(AddCleanupDeletedUsersBackgroundJob::class),

lib/private/Repair/AddAppConfigLazyMigration.php

Lines changed: 0 additions & 45 deletions
This file was deleted.

version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patch level
1010
// when updating major/minor version number.
1111

12-
$OC_Version = [33, 0, 0, 1];
12+
$OC_Version = [33, 0, 0, 2];
1313

1414
// The human-readable string
1515
$OC_VersionString = '33.0.0 dev';

0 commit comments

Comments
 (0)