Skip to content

Conversation

@marionbarker
Copy link
Collaborator

Purpose:

Fix the corner case where a pod fault is treated as an unacknowledged command during an interrupted bolus and the undelivered insulin is subtracted twice from the original bolus amount.

This was reported for both Trio and Loop (the two apps use a common set of OmniBLE and OmniKit modules):

Method

  • Recognize that getting a fault return from a pod, 0x202, should not be treated the same as not getting a podStatus return, 0x1d return. In other words, this is not an unacknowledged command.

  • Make sure the interrupted bolus is handled in only one place.

  • Ensure that the delivered insulin can never be negative.

Test

This was tested by @itsmojo who provided the code modification. Once the PR are in place, this will be tested again.

+ Clear unacknowledgedCommand on a fault return from non-status command
+ Rework to correctly handle previous unacknowledgedCommand on pod fault
+ Guard against negative bolus if dose cancel is called incorrectly
@marionbarker marionbarker requested review from itsmojo and ps2 June 29, 2025 20:15
Copy link
Contributor

@itsmojo itsmojo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a lot of testing of this for a # of corner cases involving interrupted boluses and unacknowledged commands that were previously incorrectly handled which are now all handled correctly in all cases with this changes.

@marionbarker
Copy link
Collaborator Author

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

Successfully merging this pull request may close these issues.

3 participants