You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Turning off the prediction graph silently disables the predictive low alarm (Loop only) #731
On the Loop path the predictive low alarm reads the same array the chart draws, so a display setting switches a safety alarm off with no indication in the alarm UI.
AlarmTask.alarmPredictionData() returns predictionData when the device is Loop. That array is only populated in DeviceStatusLoop behind Storage.shared.downloadPrediction.value, and its length is predictionToLoad * 12, both of which live under Graph Settings. So:
turning off prediction download leaves the array empty, and LowBGCondition skips the whole predictive branch on its !isEmpty guard, so the alarm silently degrades to a plain low alarm
setting Hours of Prediction below 1 shortens the alarm's look-ahead below whatever the user picked in the alarm editor, again with no indication
Neither is visible from the alarm screen, which still shows the predictive minutes the user chose.
The Trio and OpenAPS path is not affected. DeviceStatusOpenAPS keeps the full predBGs arrays and only uses predictionToLoad to bound a min and max scan, so the alarm gets its own series independent of the graph settings.
Fixing it properly probably means the alarm keeping its own copy of the Loop forecast rather than borrowing the chart's, the way the OpenAPS path already does. Happy to put a PR together if that sounds like the right shape.
Thanks, I think your suggestion is good and a PR in that direction would be great.
While looking at this i see that Storage.shared.downloadPrediction.value does not really do what it says. The predictions is downloaded and also processed, it should be gated in more places. That might be another PR.
Activity
bjorkert commentedon Jul 29, 2026
Thanks, I think your suggestion is good and a PR in that direction would be great.
While looking at this i see that Storage.shared.downloadPrediction.value does not really do what it says. The predictions is downloaded and also processed, it should be gated in more places. That might be another PR.