Tag bolus origin and surface it in Nightscout#2455
Open
bjorkert wants to merge 1 commit into
Open
Conversation
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.
This was referenced Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tags user-initiated boluses with where they came from (remote, watch, manual) so Nightscout can show it. Callers pass a
BolusOrigintoDeviceDataManager.enactBolus, which mints an opaque reference; the pump echoes it back on the reported dose and it is re-keyed to the dose's persistedsyncIdentifier, 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
bolusOriginand 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.