Repository navigation
Eavesdropping: listen for control responses without waiting to observe authentication - #124
Merged
Merged
Conversation
When the Dexcom app authenticates before Loop subscribes to the authentication characteristic, the authenticated notification has already gone by. Loop then never enables control notifications, drops the reading, and treats the sensor's normal disconnect as a suspected end of session. Enable control notifications right after subscribing to authentication. The authentication characteristic is not readable (write, notify, indicate), so its state can't be checked after the fact, and the sensor accepts the control subscription before the app-level auth exchange. A glucose response also clears pendingAuth, since it shows the session was authenticated. When that happens before authentication was observed, note it in the device log so these sessions can be counted in reports.
yurique
added a commit
to Artificial-Pancreas/G7SensorKit
that referenced
this pull request
Nov 21, 2026
…xes, settings split, async delegates Brings in LoopKit/G7SensorKit next-dev up to 7e15158: - LoopKit#118 readings go through delegate.notify, in order with events and alerts. - LoopKit#124 listen for control responses without waiting to observe authentication. - LoopKit#125 use the reconnect start delay only after a link that delivered a reading. - LoopKit#126 enable control notifications before authentication when eavesdropping. - LoopKit#114 settings split into Sensor and Session sections. - LoopKit#119, LoopKit#110 watch target changes (not built by iAPS); the manager now notifies CGMManagerStatusObservers of status, search and note changes. Adapted to the iAPS LoopKit dev line as before: delegate calls inside the notify blocks are not awaited, and delegateQueue stays, backed by the WeakSynchronizedDelegate queue. Needs isSearchingForSensor and shortStatusNote on CGMManager (LoopKit next-dev-port). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
dnzxy
pushed a commit
to loopandlearn/G7SensorKit
that referenced
this pull request
Dec 1, 2026
LoopKit#124) When the Dexcom app authenticates before Loop subscribes to the authentication characteristic, the authenticated notification has already gone by. Loop then never enables control notifications, drops the reading, and treats the sensor's normal disconnect as a suspected end of session. Enable control notifications right after subscribing to authentication. The authentication characteristic is not readable (write, notify, indicate), so its state can't be checked after the fact, and the sensor accepts the control subscription before the app-level auth exchange. A glucose response also clears pendingAuth, since it shows the session was authenticated. When that happens before authentication was observed, note it in the device log so these sessions can be counted in reports. (cherry picked from commit 1a82d04)
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.
Port of #121 to next-dev. It only affects eavesdropping mode; direct mode runs its own handshake.
When the Dexcom app finishes authenticating before Loop subscribes to the authentication characteristic, Loop never sees the authenticated notification, so it never enables control notifications and misses the reading. Issue reports from the developer portal show this in about 0.2–1.7% of eavesdropping sessions. Direct sessions didn't show it.
Change
pendingAuth, and the device log notes a reading that arrived before authentication was observed.How widely it was seen
From the G7 issue reports on the LoopKit developer portal:
Testing
LoopWorkspace next-dev builds. The same change on main ran on an iPhone alongside the Dexcom G7 app. This port hasn't run on a phone.