Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify handling of carbs entered at the same Hour and Minute #2134

Open
marionbarker opened this issue Feb 20, 2024 · 4 comments
Open

Modify handling of carbs entered at the same Hour and Minute #2134

marionbarker opened this issue Feb 20, 2024 · 4 comments

Comments

@marionbarker
Copy link
Contributor

Is your feature request related to a problem? Please describe.

  • If more than one carb entry has the same time-stamp in HH:mm, the ordering in Loop depends on the sec and msec at which the entry was entered.
  • When uploading to Nightscout, if more than one entry has the same HH:mm:ss timestamp, only one is saved in Nightscout, the other is removed.
  • The odds of a remote carb entry with the same HH:mm selection vanishing from Nightscout is 1 in 1 if the Nightscout Careportal is used and 1 in 60 if the LoopCaregiver UI is used.
  • Similarly, the odds of a Loop UI entered carb entry vanishing from Nightscout is 1 in 60 when the same HH:mm time is selected in the time picker.

Describe the solution you'd like
Possible solution:

  • For each new carb entry, determine if an existing entry has the same HH:mm time, if so, modify the time of the new entry to be one sec later than the latest existing entry in the HH:mm interval
    • Nightscout will then report every carb entry as a treatment instead of possibly discarding one
  • Another advantage of this proposed solution is that if someone choses to make 2 (or more entries) for the same meal with different absorption times, the order of the displayed carbs will match order of entry

Additional context
This issue with the way Nightscout handles carb entries (see nightscout/cgm-remote-monitor#8185) was discovered by someone using remote carb entries, but it also happens when entering carbs in Loop UI itself.

Test Case:

  1. Enter carb values repeatedly in the Loop UI with different values and absorptions times.
    • First add a 10 U non-pump bolus so no bolus is recommended after each carb entry
    • Then add 1, 2, 3, 4 and 5 U entries with 3 hours absorption using the same entry time of 13:00 on the time picker
    • Repeat the 1-5 for 30 min absorption, then 5 hour absorption and then 1 hour absorption times
  2. Twenty entries was enough to hit the 1 in 60 chance two times

The display order of the entries does not match the entry order because of different seconds in the 13:00 saved timestamp.

  • Loop has all 20 entries (left side of graphic)
  • Nightscout has only 18 entries (right side of graphic)

carb-order-and-ns-issue

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Mar 22, 2024
@marionbarker
Copy link
Contributor Author

Bump

@github-actions github-actions bot removed the stale label Mar 23, 2024
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Apr 22, 2024
@marionbarker
Copy link
Contributor Author

Bump

@github-actions github-actions bot removed the stale label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant