multipass icon indicating copy to clipboard operation
multipass copied to clipboard

Handle bad settings read from disk

Open ricab opened this issue 3 years ago • 2 comments

Be robust to bad setting values read from disk, by logging the occurrence, resetting, and returning the default.

The lazy approach taken here reuses SettingSpec::interpret, but it imposes a new constraint on it: it needs to be able to validate already "interpreted" (marshalled) settings. I want to see how this goes on different platforms and integration tests.

If this works, we can rely on it to reset hyperkit to qemu once the former is gone (because the latter will be the default by then). Otherwise, we could try to finally move to a marshall/unmarshall scheme, or just tackle the hyperkit case with dedicated code.

ricab avatar Sep 13 '22 17:09 ricab

Codecov Report

Merging #2742 (65dc52e) into main (9c15247) will decrease coverage by 0.02%. The diff coverage is 78.57%.

@@            Coverage Diff             @@
##             main    #2742      +/-   ##
==========================================
- Coverage   86.41%   86.39%   -0.02%     
==========================================
  Files         230      230              
  Lines       11575    11586      +11     
==========================================
+ Hits        10002    10010       +8     
- Misses       1573     1576       +3     
Impacted Files Coverage Δ
src/settings/wrapped_qsettings.h 16.66% <0.00%> (-1.86%) :arrow_down:
src/settings/persistent_settings_handler.cpp 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Sep 13 '22 17:09 codecov[bot]

Un-drafting to get a Windows run too.

ricab avatar Sep 14 '22 18:09 ricab

This still needed some work after all. One unit test missing at this point.

ricab avatar Jan 18 '23 20:01 ricab

Actually I think this is good enough. The only missing coverage is on the QSettings wrapper (which we decided before didn't need testing).

ricab avatar Jan 20 '23 11:01 ricab

Hey @townsend2010, just to let you know that this is now ready for review.

ricab avatar Jan 20 '23 11:01 ricab

bors try

townsend2010 avatar Jan 20 '23 17:01 townsend2010

Build failed:

bors[bot] avatar Jan 21 '23 03:01 bors[bot]

The danged clang crash in CI...

bors retry

townsend2010 avatar Jan 21 '23 16:01 townsend2010