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
Pending Bolus calculation heuristic is potentially dangerous #273
Afaict from the code, lastBolus is set if a Bolus has been successfully enacted. In insulinEffect, didSet the lastBolus var is cleared if it is older than 5 minutes.
There seems to be no mechanism which makes sure the Bolus has actually been read from the pump event history (or reservoir data). Hence if this doesn't happen and the user Bolus again there is a potential for going low.
Second issue I see is that if a user bolus' again within the 5 minute window, the last one is silently overwritten. So if let's say the first one is 3 Units, the second one 1 Unit, and the user enters another Carb-Meal, it will only substract the 1 Unit, not 4 Units from the calculated amount.
I'd think there are at least two different ways of fixing this:
don't allow Bolus until the full eventHistory (or reservoir state) has been read back again, and a full loop has been completed (most safe probably)
record bolus directly in doseStore and replace later, when the pump history has been synced beyond this point.
In any case, this should probably be addressed rather soon if someone can confirm this is actually a problem.
It's a bit complicated by the fact that on older (x22) pumps, the record isn't added to the history until the delivery is finished. Add in that older pumps deliver insulin slowly, and you have quite a long time before a bolus is added to the history (tops out at 16minutes on x22 @25u).
We may need to maintain a list of 'unconfirmed boluses', along with their expected delivery times, to be able to clear them out reliably.
I personally also like the 2nd solution ("unconfirmed bolus'") more because it allows to do accurate additional corrections in the mean time and doesn't block the interface for very long.
Just ran into this (or something quite like it) today. Running Loop v1.4.0. Entered carbs for part of my breakfast, then accepted the bolus recommendation, which delivered successfully. A few minutes later (after bolus was completed, but before it was pulled from pump into history), I entered more carbs, and the bolus recommendation was the amount needed for both sets of carbs, i.e. it was bigger than it should have been by an amount equal to the previous bolus. I noticed it and manually subtracted, but it would be easy for a user to make a mistake here.
Not sure about the best resolution - one option would be just tracking pending boluses as @ps2 suggested, and either subtract that from recommended bolus, or at least provide that info to the user on the bolus screen.
If this isn't the same issue, let me know and I'll open a separate one.
I actually saw the same thing today. Did a bolus for my main meal, but a few minutes later added more carbs for a cookie and it recommended a bolus that seemed way too big. I ignored it, and decided to bolus a much smaller dose, and thought I should write up an Issue, but yeah +1 for what @elnjensen said
On Tue, Aug 8, 2017 at 3:35 AM, David Cintron ***@***.***> wrote:
I actually saw the same thing today. Did a bolus for my main meal, but a
few minutes later added more carbs for a cookie and it recommended a bolus
that seemed way too big. I ignored it, and decided to bolus a much smaller
dose, and thought I should write up an Issue, but yeah +1 for what
@elnjensen <https://github.com/elnjensen> said
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#273 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAE2aqM5u_eGdtmBy3Gvwu5e0st_UKoHks5sV7tNgaJpZM4K40i4>
.
Just ran into this again tonight. Entered 30 g carbs, accepted bolus recommendation of 2.15u, saw that bolus was starting. About 7 minutes later, I decided the carb count was a bit low, so I entered 10 g more carbs. (New carb entry, not edit of the old one.) Recommended bolus was 2.75u, and "Active insulin" showed as 0.17u. (I didn't deliver the bolus.) My carb ratio for this period is 10g/u, so that bolus recommendation was clearly for all the carbs, not just the new 10g. About 2 minutes later, the recommended bolus was down to 0.575u, and then showed the active insulin from the previous bolus. So the risk window isn't super long, but it's there.
I've attached an issue report, plus screenshots of the two bolus recommendations. Let me know if more info is useful.
has anyone had an issue with larger bolus recommendations as described in this issue since updated Loop versions? We have not seen any issues like this for quite a long time...i think the pending boluses have been tracked well for us. Just checking if this issue needs to remain open or is ready to close?
Activity
ruess commentedon Nov 22, 2016
I like the first resolution personally
ps2 commentedon Nov 22, 2016
It's a bit complicated by the fact that on older (x22) pumps, the record isn't added to the history until the delivery is finished. Add in that older pumps deliver insulin slowly, and you have quite a long time before a bolus is added to the history (tops out at 16minutes on x22 @25u).
We may need to maintain a list of 'unconfirmed boluses', along with their expected delivery times, to be able to clear them out reliably.
ps2 commentedon Nov 22, 2016
If we track bolus confirmation more accurately, it should apply to #131
trixing commentedon Nov 22, 2016
I personally also like the 2nd solution ("unconfirmed bolus'") more because it allows to do accurate additional corrections in the mean time and doesn't block the interface for very long.
ruess commentedon Nov 22, 2016
Makes sense @ps2
elnjensen commentedon Aug 8, 2017
Just ran into this (or something quite like it) today. Running Loop v1.4.0. Entered carbs for part of my breakfast, then accepted the bolus recommendation, which delivered successfully. A few minutes later (after bolus was completed, but before it was pulled from pump into history), I entered more carbs, and the bolus recommendation was the amount needed for both sets of carbs, i.e. it was bigger than it should have been by an amount equal to the previous bolus. I noticed it and manually subtracted, but it would be easy for a user to make a mistake here.
Not sure about the best resolution - one option would be just tracking pending boluses as @ps2 suggested, and either subtract that from recommended bolus, or at least provide that info to the user on the bolus screen.
If this isn't the same issue, let me know and I'll open a separate one.
loudestnoise commentedon Aug 8, 2017
I actually saw the same thing today. Did a bolus for my main meal, but a few minutes later added more carbs for a cookie and it recommended a bolus that seemed way too big. I ignored it, and decided to bolus a much smaller dose, and thought I should write up an Issue, but yeah +1 for what @elnjensen said
trixing commentedon Aug 8, 2017
elnjensen commentedon Nov 11, 2017
Just ran into this again tonight. Entered 30 g carbs, accepted bolus recommendation of 2.15u, saw that bolus was starting. About 7 minutes later, I decided the carb count was a bit low, so I entered 10 g more carbs. (New carb entry, not edit of the old one.) Recommended bolus was 2.75u, and "Active insulin" showed as 0.17u. (I didn't deliver the bolus.) My carb ratio for this period is 10g/u, so that bolus recommendation was clearly for all the carbs, not just the new 10g. About 2 minutes later, the recommended bolus was down to 0.575u, and then showed the active insulin from the previous bolus. So the risk window isn't super long, but it's there.
I've attached an issue report, plus screenshots of the two bolus recommendations. Let me know if more info is useful.
Issue report Nov 10, 7 35 51 PM.txt
Kdisimone commentedon Oct 19, 2018
has anyone had an issue with larger bolus recommendations as described in this issue since updated Loop versions? We have not seen any issues like this for quite a long time...i think the pending boluses have been tracked well for us. Just checking if this issue needs to remain open or is ready to close?
elnjensen commentedon Oct 21, 2018
I haven't seen this for a long time either.
Kdisimone commentedon Nov 29, 2018
Closing