mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-11 01:26:37 +00:00
fix(config): drop retired skin/skin_options keys instead of validating them
A config.json written while the skin system existed can carry skin and skin_options in any plugin section, and most plugin schemas set additionalProperties: false. They are no longer core plugin properties; RETIRED_PLUGIN_KEYS in schema_manager lists them and drop_retired_plugin_keys removes them (unless the plugin's own schema declares the name) in prepare_plugin_config, which loading, hot reload, GET /plugins/config and both web saves already share, and in validate_config_against_schema for callers that validate a raw section. POST /plugins/config and /config/main also drop them from the stored section they merge into, so they leave config.json on the next save. Tests cover the load path (real PluginManager.load_plugin: no schema warning, not degraded), raw and prepared validation, validate_all_plugin_configs, and the JSON, form and /config/main saves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1052,10 +1052,14 @@ def save_main_config():
|
||||
if error:
|
||||
return error
|
||||
|
||||
# Deep merge regular config into main config
|
||||
# Deep merge regular config into main config, dropping
|
||||
# retired core keys (skin, skin_options) from the stored section
|
||||
from src.plugin_system.schema_manager import drop_retired_plugin_keys
|
||||
stored_section = current_config.get(plugin_id)
|
||||
current_config[plugin_id] = deep_merge(
|
||||
stored_section if isinstance(stored_section, dict) else {}, regular_config)
|
||||
drop_retired_plugin_keys(
|
||||
stored_section if isinstance(stored_section, dict) else {}, schema),
|
||||
regular_config)
|
||||
if secrets_config:
|
||||
plugin_secrets_updates[plugin_id] = secrets_config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user