Skip to content

Refuse remote boluses and carbs that the sender had not seen - #2692

Open
bjorkert wants to merge 2 commits into
LoopKit:next-devfrom
bjorkert:remote-guard
Open

bjorkert wants to merge 2 commits into
LoopKit:next-devfrom
bjorkert:remote-guard

Conversation

@bjorkert

@bjorkert bjorkert commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Checks each remote bolus and carb command against the history, the running bolus and the last accepted remote bolus, one command at a time. Depends on LoopKit/LoopKit#704 and #2691. Context in LoopKit/LoopWorkspace#594.

enactBolus rethrows the pump's error for doses with a remote origin, including uncertain delivery, so the remote command reports the failure to its sender and sends the remote bolus failure notification.
A remote bolus is refused when insulin the sender could not have seen adds up to 20 % or more of the requested amount, and a remote carb entry is refused when any carb entry was added that the sender had not seen. Unseen means dated after the command was sent, not uploaded to Nightscout, or uploaded after the newest treatment the sender had fetched. A running bolus and the last accepted remote bolus count. Commands are checked one at a time and are carried out as sent or refused.
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.

1 participant