Skip to content

Send the newest treatment seen with remote bolus and carb commands - #842

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

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

Conversation

@bjorkert

@bjorkert bjorkert commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

LoopFollow now sends the Nightscout id of the newest treatment it had when the bolus, meal or carb screen was opened. Loop and Trio use it to refuse a command if something was added that the caregiver had not seen. Trio commands also get an id so they never run twice. Replies now stay in Notification Center when the app is open, so the reason for a refusal can be read. Older Loop and Trio ignore the new fields. Companion to LoopKit/LoopWorkspace#594 and nightscout/Trio#1789.

The bolus, meal and carb screens take the Nightscout id of the newest treatment LoopFollow had fetched when they open, and send it with the command as known-through-id to Loop and known_through_id to Trio, which use it to refuse a command if something was added that the caregiver had not seen. Trio bolus and meal commands carry a command id, and Loop commands expire 12 minutes after they are sent. Commands from the watch carry no id. Replies to remote commands stay in Notification Center while the app is open.
# Conflicts:
#	RemoteShared/PushMessage.swift
@marionbarker

Copy link
Copy Markdown
Collaborator

Claude Review and Test

❌ The finding identified by Claude was reproduced on a test phone.

Finding

# Severity Topic
1 Important (design) Returning to the foreground takes in treatments the caregiver never saw

Test Details

  1. Enter carbs (45 g)
  2. On LF Phone: Wait for rec bolus to appear
  3. On LF Phone: Enter Remote bolus screen, select the 2.4 U bolus but don't hit continue - switch to a different app
  4. On Trio Phone: Enter 1 U bolus
  5. On LF Phone, return to LoopFollow app - returns to home screen
  6. On LF phone, tap remote bolus - the screen is still configured with the 2.4 U bolus queued up, I tapped Send Bolus and it sent it
  7. First time I tested this., the Trio phone was bolusing and rejected to command so I repeated it (with a smaller bolus on Trio phone) and waited for bolus to complete before hitting Send Bolus

For this second test: Trio phone shows both the 1.0 U local bolus plus the 2.4 U remote bolus.

Copy of Claude review

PR-842-review-20261129.md

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.

2 participants