Skip to content

Harden settings deserialisation against corrupt or partial data#24

Merged
MBurchard merged 1 commit intomainfrom
harden-settings-toml
Mar 27, 2026
Merged

Harden settings deserialisation against corrupt or partial data#24
MBurchard merged 1 commit intomainfrom
harden-settings-toml

Conversation

@MBurchard
Copy link
Copy Markdown
Owner

  • Add lenient_option deserializer that returns None for type mismatches instead of failing the entire settings file
  • Make all WindowSettings and GameUiSettings fields nullable (Option) so missing or corrupt values degrade gracefully
  • Window restore handles partial data: position and size are restored independently, either can be absent
  • HintSettings.minimize_to_tray stays u32 with default 0 (internal counter, not user-facing)

- Add lenient_option deserializer that returns None for type mismatches instead of failing
  the entire settings file
- Make all WindowSettings and GameUiSettings fields nullable (Option<T>) so missing or
  corrupt values degrade gracefully
- Window restore handles partial data: position and size are restored independently,
  either can be absent
- HintSettings.minimize_to_tray stays u32 with default 0 (internal counter, not user-facing)
@MBurchard MBurchard merged commit 8a723df into main Mar 27, 2026
1 check passed
@MBurchard MBurchard deleted the harden-settings-toml branch March 27, 2026 13:49
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.

1 participant