MSS icon indicating copy to clipboard operation
MSS copied to clipboard

Fix #2885: Prevent crash on corrupted performance settings

Open Delta17920 opened this issue 3 months ago • 1 comments

Purpose of PR?:

Fixes #2885

This PR adds a type check to the load_settings method in mslib/msui/flighttrack.py. It ensures that performance_settings is always initialized as a dictionary. If the loaded configuration data is corrupted (e.g., loaded as a str instead of a dict), the application now safely falls back to DEFAULT_PERFORMANCE instead of crashing with a TypeError.

Does this PR introduce a breaking change?

No

If the changes in this PR are manually verified, list down the scenarios covered::

Manually verified by temporarily modifying the code to force performance_settings to be a string ("corrupted data"). Confirmed that the application detected the invalid type, reverted to the default dictionary, and launched successfully without crashing.

Additional information for reviewer? : None

Does this PR results in some Documentation changes? No

Checklist:

  • [x] Bug fix. Fixes #2885
  • [ ] New feature (Non-API breaking changes that adds functionality)
  • [x] PR Title follows the convention of <type>: <subject>
  • [ ] Commit has unit tests

Delta17920 avatar Nov 22 '25 12:11 Delta17920

It seems the tests failed on test_milestone_url with an AssertionError: Expected milestone format not found. This appears to be unrelated to my changes in flighttrack.py (likely a network issue or a change in the GitHub HTML response). Could you please re-run the CI?

Delta17920 avatar Nov 28 '25 03:11 Delta17920

Please provide a test demonstrating the improved behaviour. I can neither replicate the issue nor validate whether the fix solves anything. Eg a test that fails with the old code, but not with the new one.

joernu76 avatar Dec 03 '25 13:12 joernu76