Describe the bug
When using mmol/L as glucoses units, all instances of GlucoseRangePicker (used to select normal correction range and premeal correction range) share a common bug: when setting the range to the lowest possible value to the lowest possible value OR the highest possible value to the highest possible value the app oftentimes crashes.
To Reproduce
Steps to reproduce the behavior:
- Use mmol/L as glucose unit
- Adjust correction range to 4.4-4.4 or 10.0-10.0 in either onboarding or settings (likely chance of crash)
- Adjust premeal range to 4.4-4.4 or 10.0-10.0 in either onboarding or settings (likely chance of crash)
Expected behavior
The app should accept these values
Phone
Loop Version
- Current dev workspace (9fd16c2) with the newest LoopKit/LoopKit submodule (7134679)
Why this happens
From brief sleuthing, it appears to be due to a rounding error from mg/dL to mmol/L where the minValue is just higher than the maxValue of the range.
Describe the bug
When using mmol/L as glucoses units, all instances of GlucoseRangePicker (used to select normal correction range and premeal correction range) share a common bug: when setting the range to the lowest possible value to the lowest possible value OR the highest possible value to the highest possible value the app oftentimes crashes.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The app should accept these values
Phone
Loop Version
Why this happens
From brief sleuthing, it appears to be due to a rounding error from mg/dL to mmol/L where the minValue is just higher than the maxValue of the range.