Commit 2284d89
Don't snooze high alarm when there is no IOB (#6348)
The Bolus Wizard Preview plugin snoozes a high alarm when its
`bolusEstimate` is below the snooze threshold, treating that as "enough
insulin on board to cover the high". But `bolusEstimate` is 0 in a case
that has nothing to do with IOB coverage: when the BG is above the alarm
threshold (`bgTargetTop`) yet still below the profile's high target, so
neither the high nor low branch of calc() runs. With no insulin on board
this leaves bolusEstimate at its initial 0 and a genuine high alarm is
silenced -- the scenario reported in #6348 (complete profile, no insulin
treatments). Because the snooze is requested at URGENT level and
snoozedBy() matches by level across the group, it can also suppress other
urgent alarms for the snooze duration.
Guard the snooze on `prop.iob > 0` so a high is only snoozed when there
is actually insulin on board to cover it. Legitimate "enough IOB"
snoozing is unchanged.
Adds regression tests for the reported scenario (BG below the profile
high target with no IOB) and for the unchanged enough-IOB snooze.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 17283fe commit 2284d89
2 files changed
Lines changed: 46 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
111 | 115 | | |
112 | 116 | | |
113 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
300 | 341 | | |
301 | 342 | | |
302 | 343 | | |
| |||
0 commit comments