Skip to content

Silence the 'surround' unknown-config-key warning for pre-#432 edits#457

Merged
marcinz606 merged 1 commit into
marcinz606:mainfrom
linkmodo:fix/legacy-config-key-noise
Jul 12, 2026
Merged

Silence the 'surround' unknown-config-key warning for pre-#432 edits#457
marcinz606 merged 1 commit into
marcinz606:mainfrom
linkmodo:fix/legacy-config-key-noise

Conversation

@linkmodo

Copy link
Copy Markdown
Contributor

Problem

After #432 removed ExposureConfig.surround (dim-surround gamma, superseded by Snap), every edit saved before that merge still carries the key in edits.db / sidecars. WorkspaceConfig.from_flat_dict now logs on every file load for upgrading users:

WARNING negpy.domain.models: Dropping unknown config keys: ['surround']

The key is correctly discarded — the warning is just noise, and it recurs until each edit happens to be re-saved.

Fix

Track deliberately-removed fields in a small legacy_keys set that is dropped silently (with a comment noting what removed each key and when). Genuinely unknown keys keep the warning, so it still flags real corruption or version skew.

Testing

Round-trip check: a config dict with surround loads with no warning; an actually-unknown key still warns. tests/test_config_deserialization.py (18 tests) passes; ruff clean.

PR marcinz606#432 removed ExposureConfig.surround (dim-surround gamma, superseded by
Snap), but every edit saved before that still carries the key in edits.db /
sidecars, so from_flat_dict logged "Dropping unknown config keys: ['surround']"
on every file load for upgrading users. Track deliberately-removed fields in a
legacy set that drops silently; genuinely unknown keys keep the warning.
@marcinz606 marcinz606 merged commit fec9626 into marcinz606:main Jul 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants