Fix/backup restore with invalid settings (#1793)

* Fix typo in setting validation error message

* Convert value to internal type before validating it

* Only update setting in case value is valid

* Ignore settings validation errors on backup restore

* Remove potential not privacy safe value from logs
This commit is contained in:
schroda
2025-11-26 03:56:57 +01:00
committed by GitHub
parent b58a716daa
commit aa8d27f679
4 changed files with 30 additions and 11 deletions

View File

@@ -35,7 +35,7 @@ object SettingsBackupSettingsHandlerGenerator {
appendLine(
KotlinFileGeneratorHelper.createImports(
listOf(
"suwayomi.tachidesk.graphql.mutations.SettingsMutation",
"suwayomi.tachidesk.server.settings.SettingsUpdater",
"suwayomi.tachidesk.manga.impl.backup.BackupFlags",
"suwayomi.tachidesk.manga.impl.backup.proto.models.BackupServerSettings",
"suwayomi.tachidesk.server.serverConfig",
@@ -77,7 +77,7 @@ object SettingsBackupSettingsHandlerGenerator {
appendLine("fun restore(backupServerSettings: BackupServerSettings?) {".addIndentation(indentation))
appendLine("if (backupServerSettings == null) { return }".addIndentation(contentIndentation))
appendLine()
appendLine("SettingsMutation().updateSettings(".addIndentation(contentIndentation))
appendLine("SettingsUpdater.updateAll(".addIndentation(contentIndentation))
appendLine("backupServerSettings.copy(".addIndentation(indentation * 3))
val deprecatedSettings = settings.filter { it.typeInfo.restoreLegacy != null }