Repository navigation
update.locales: false is overwritten by checkVersion task #8190
DescriptionSetting the following configuration: update:
locales: falsedoes not reliably disable automatic locale updates. The if (WIKI.config.update?.locales === false) {
return
}However, the WIKI.config.update = {
lastCheckedAt: new Date().toISOString(),
version: strictVersion,
versionDate: resp.published_at
}
await WIKI.configSvc.saveToDb(['update'])As a result, the existing After undefined === falseand Steps to reproduce
update:
locales: false
I reproduced this with a locally customized Expected behaviorWith: update:
locales: falseconfigured, automatic locale updates should remain disabled, including after the Version checks and other online functionality should continue to work normally. Actual behavior
The subsequent WIKI.config.update.locales === falseand downloads the locale again. Suggested fixPreserve the existing properties of Instead of: WIKI.config.update = {
lastCheckedAt: new Date().toISOString(),
version: strictVersion,
versionDate: resp.published_at
}use: WIKI.config.update = {
...WIKI.config.update,
lastCheckedAt: new Date().toISOString(),
version: strictVersion,
versionDate: resp.published_at
}This would preserve: update:
locales: falsewhile still updating |
Replies: 3 comments
|
I can confirm this on the current What happens:
This is why your customized wiki/backend/models/locales.ts Lines 542 to 548 in fc365d6 wiki/backend/models/locales.ts Line 421 in fc365d6 One thing to watch with the suggested spread fix: A variant that keeps the file setting out of the database: const latest = {
lastCheckedAt: new Date().toISOString(),
version: strictVersion,
versionDate: resp.published_at
}
// -> Persist only what this task owns, so a flag that comes from config.yml stays there
await WIKI.models.settings.updateConfig('update', latest)
WIKI.config.update = { ...WIKI.config.update, ...latest }
WIKI.events.outbound.emit('reloadConfig')With this, Until a fix is merged, the only config-only way to stop the nightly download is |
|
Thanks for confirming this and for the detailed analysis. This exactly matches the behavior I observed on my installation, including the custom cs-CZ locale being replaced after checkVersion / updateLocales runs. For now, I have a temporary workaround in place that restores my custom cs-CZ.json after the nightly locale update, so I can safely wait for an upstream fix. The proposed approach of keeping the locales setting in config.yml and persisting only the version-related fields to the database makes sense to me. Thanks for looking into this! |
Fixed via c1d4dfe. Will land in next release.