Thread bolusReference through bolus delivery - #101
Closed
bjorkert wants to merge 2 commits into
Closed
Conversation
Persist and echo the caller-supplied bolus reference via UnfinalizedDose and PendingCommand, so it survives an app restart while delivery is in progress and is stamped on the reported DoseEntry for both certain and uncertain delivery.
Match the LoopKit change: thread UUID instead of String, serialized as uuidString in the rawValue round-trips.
Member
Author
|
Superseded by the dev-targeted PR above — same change rebased onto dev so Loop and Trio can share one OmnipodKit commit. |
jeremybarnum
pushed a commit
to jeremybarnum/OmnipodKit
that referenced
this pull request
Aug 19, 2026
…cted Field 2026-08-19 12:56:53.974: timedConnect and adopt-retry both issued connect() for the same pod in the SAME MILLISECOND, CoreBluetooth answered CBError 11, and a single connect 0.75s later succeeded against an unchanged system. The ledger cleared the two competing explanations in the same session. ORPHANED=1 stood across connects that SUCCEEDED, so a leaked intent does not hold a slot -- which kills the recreateCentral leak theory this instrumentation was built to test. And the G7 had disconnected 2.3s before the refusal, so it was not holding the link either. What was left was our own duplicate. noteConnectIssued now returns a verdict and callers skip connect() when one is already in flight. Suppressions are COUNTED, not silent: if suppressed=N climbs while reclaims still fail, the duplicate was not the disease and the next suspect is watchOS releasing a slot lazily (2.3s too soon, 3.0s enough). Guards .connecting only. Connecting an already-.connected peripheral makes CoreBluetooth re-deliver didConnect immediately and some state machine may lean on that; this file compiles into the PHONE as well as the watch, so suppressing it would risk wedging the phone's pod link to fix a watch symptom. freshConnect passes force: its whole purpose is cancel-then-reconnect. G7SensorKit learned this as the loopandlearn#101 churn fix; the pod path never got it.
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.
Carries the bolusReference from enactBolus through UnfinalizedDose and PendingCommand and stamps it on the reported DoseEntry, so it survives an app restart while a bolus is in progress. Stored as a uuid string in the pod raw state.
Part of the bolus origin work: LoopKit/LoopKit#594 and nightscout/Trio#1252.