Skip to content

Tag bolus origin and surface it in Nightscout#2455

Open
bjorkert wants to merge 1 commit into
LoopKit:devfrom
bjorkert:bolus-origin
Open

Tag bolus origin and surface it in Nightscout#2455
bjorkert wants to merge 1 commit into
LoopKit:devfrom
bjorkert:bolus-origin

Conversation

@bjorkert

@bjorkert bjorkert commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Tags user-initiated boluses with where they came from (remote, watch, manual) so Nightscout can show it. Callers pass a BolusOrigin to DeviceDataManager.enactBolus, which mints an opaque reference; the pump echoes it back on the reported dose and it is re-keyed to the dose's persisted syncIdentifier, where NightscoutService resolves it at upload time. A failed bolus carries its origin through the failure notification so a retry keeps it.

Tested on a phone with a pod: remote/watch/manual boluses arrive in Nightscout with bolusOrigin and a readable note, automatic boluses unaffected.

Depends on LoopKit/LoopKit#594 (bolusReference + BolusOriginStore) and loopandlearn/OmnipodKit#102 (pod echoes the reference). Upload side: LoopKit/NightscoutKit#3 and LoopKit/NightscoutService#27. Trio uses the same shared kit changes in nightscout/Trio#1252.

Tag user-initiated boluses with where they came from (remote, watch,
manual) using LoopKit's BolusOriginStore. Callers pass a BolusOrigin to
DeviceDataManager.enactBolus, which mints an opaque reference once the
command actually goes to the pump; the pump echoes it back on the
reported dose and it is re-keyed to the dose's persisted syncIdentifier,
where NightscoutService resolves it at upload time.

A definite failure drops the mapping, but the origin rides along on the
failure notification so a retried bolus keeps its provenance. Uncertain
delivery keeps the mapping since the dose may still be reported later.
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