🐛 Problem
The settings validator accepts a number with surrounding whitespace, but the engine reads the same value as invalid. The saved setting then has no effect, and nothing tells the operator.
SettingValidator.IsDoubleInRange / IsDoubleAboveAndAtMost (src/GenWave.Host/Configuration/SettingValidator.cs) parse with NumberStyles.Float, which allows leading and trailing whitespace. So "3 " passes validation and is saved.
- In the engine container, Liquidsoap's
float_of_string("3 ") fails, so genwave.liq falls back to the default.
Result: the operator saves GW_XFADE_MIN = "3 ", gets a success, and the engine keeps running 2.0. Once F213 (gh-#879) ships, /api/status will also report a restartNeeded that no restart can clear.
The problem was found while reviewing T601, part of F213.
✅ Fix options
- Validator (preferred). Parse the engine-bound doubles with
NumberStyles.AllowLeadingSign | AllowDecimalPoint | AllowExponent, so whitespace is rejected with a 400.
- Trim on save, so the stored value matches what the engine can parse.
Either way, add a spec: saving "3 " gives a 400, or it is stored as "3".
The affected keys are every number setting served by /internal/engine-config: GW_XFADE_MIN, GW_XFADE_MAX and GW_SAFE_GAP_SECONDS.
🐛 Problem
The settings validator accepts a number with surrounding whitespace, but the engine reads the same value as invalid. The saved setting then has no effect, and nothing tells the operator.
SettingValidator.IsDoubleInRange/IsDoubleAboveAndAtMost(src/GenWave.Host/Configuration/SettingValidator.cs) parse withNumberStyles.Float, which allows leading and trailing whitespace. So"3 "passes validation and is saved.float_of_string("3 ")fails, sogenwave.liqfalls back to the default.Result: the operator saves
GW_XFADE_MIN = "3 ", gets a success, and the engine keeps running 2.0. Once F213 (gh-#879) ships,/api/statuswill also report arestartNeededthat no restart can clear.The problem was found while reviewing T601, part of F213.
✅ Fix options
NumberStyles.AllowLeadingSign | AllowDecimalPoint | AllowExponent, so whitespace is rejected with a 400.Either way, add a spec: saving
"3 "gives a 400, or it is stored as"3".The affected keys are every number setting served by
/internal/engine-config:GW_XFADE_MIN,GW_XFADE_MAXandGW_SAFE_GAP_SECONDS.