Skip to content

Loop can skip/miss Manual Boluses resulting in incorrect IoB #853

Closed

Description

@shanselman

Describe the bug

I took 5U AT 10:05am manually via audio bolus. The manual bolus shows up in my pump history and Loop sees it in Event History (see pic.) I RARELY bolus this way so I am not sure what the expected behavior is. I would personally expect Loop to see the bolus in history and have it show up as IoB.

I am on 1.9.4dev so I’m feeling this may be related to the “Loop stores insulin in HealthKit” path? Perhaps it’s using HealthKit as the authoritative source and not seeing the Bolus?

It feels like if Loop misses a manual Bolus (perhaps while the bolus is long running?) and then Loop temp basals and records that temp to HealthKit that it won’t look back in Event History and see the previous manual bolus.

UPDATE: I went into HealthKit and manually deleted Insulin Delivery Record’s going back until 10am, then force quit Loop. Loop then recovered and populated IoB correctly. This was an interesting bug/issue as because Loop thought I had no IoB it had Temp Basaled me to 3U/hr which would have been a problem later.

Attach an Issue Report

Attached Loop Report 2018-12-12 11_00_24-08_00.zip

To Reproduce
Guessing here, will try to repro again. Steps to reproduce the behavior:

  1. Enable Loop to log Insulin in HealthKit
  2. Largeish manual bolus
  3. Loop loops and temp basals shortly after bolus.
  4. Loop misses manual loop. Should show manual bolus as IoB but doesn't.

Expected behavior
I'd expect loop to look back n number of events in case it missed a manual bolus, rather than using (?) HealthKit as the authoritative source.

Screenshots
Note the bolus around 10:05am
img_2846
Bolus recorded here at 10:05am
img_2847
Bolus missing from HealthKit. Instead a 1.05U basal is present? Then follow up basals.
img_2848
Note missing basal
img_2849

Phone

  • Hardware: iPhone XS Max
  • OS Version: 12.1.1 (16C50)

Loop Version

  • Version Number: 1.9.4
  • Repo: LoopKit/dev

CGM

  • Device: Dexcom G5
  • Manager app: Dexcom App

Pump

  • Manufacturer: Medtronic
  • Model: 522
  • Firmware version: 2.4a 1.1 0B 0B

Additional context
I was having a considerable low at the time and Loop had me temped at 0. I was taking the 5U in anticipation of a very large lunch.

Activity

  1. elnjensen commented on Dec 14, 2018

    @elnjensen
    Contributor

    I've had no problem in the past with Loop seeing manual boluses (though it can take a little time before it pulls the history and sees the bolus). Curious to see if you can reproduce it; I'll try as well with some manual boluses to see what happens. Was Loop completely successfully (green loop) between when you gave the bolus and when you took the above screenshots?

  2. ps2 commented on Jan 8, 2019

    @ps2
    Collaborator

    This fix is in Loop dev now. Please test if you can. The issue happens on x22 medtronic pumps when 1) A (large) bolus is started. 2) A temp basal ends before the bolus finishes. 3) Loop fetches pump history as part of a normal loop before the bolus finishes.

  3. shanselman commented on Jan 8, 2019

    @shanselman
    ContributorAuthor

    Amazing! Glad you found this. It's so awesome to hunt down weird - but significant - bugs like this! THANK YOU! 🥇

  4. fgutteridge commented on Jan 28, 2019

    @fgutteridge

    Hey there, new Looper here.

    I'm having an issue similar to the one described here. Loop fails to write the Insulin Delivery data to HealthKit, and therefore no bolus is logged. It shows up in Loop, but when I restart the app, all boluses disappear (presumably as Loop reads HealthKit's ID data as blank).

    Loop has no issue in reading/writing my carbohydrate data to HealthKit, and repopulating the graph after a restart, so I struggle to understand the exact cause of this issue.

    This is even after updating to the newest release, 1.9.4. Any and all help/suggestions is insanely appreciated! Your hard work and dedication to this life-changing project certainly does not go unnoticed.

  5. ps2 commented on Jan 28, 2019

    @ps2
    Collaborator

    @fgutteridge go to settings app -> privacy -> health -> Loop, and make sure Loop has all insulin permissions enabled.

  6. fgutteridge commented on Jan 28, 2019

    @fgutteridge

    Wish it had been as simple as that! Thanks for the quick reply.

    Figured out that Loop wasn't updating with my pump correctly, and therefore wasn't retrieving the pump data in a timely (enough) manner. As soon as this was resolved, all of my boluses were populated in the health app.

    Thank you for getting back to me so quickly! You truly are a God-send for this community. I hope to make some contributions myself, as my familiarity with the project improves (I'm an intermediate developer and graphic artist myself).

    Thanks again. Happy Monday.

  7. Kdisimone commented on Jan 28, 2019

    @Kdisimone
    Collaborator

    Sounds like it’s all resolved. Thanks Pete!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions