Skip to content

Await the async CGMManagerDelegate calls; drop delegateQueue - #118

Merged
ps2 merged 1 commit into
next-devfrom
async-delegates
Nov 12, 2026
Merged

ps2 merged 1 commit into
next-devfrom
async-delegates

Conversation

@ps2

@ps2 ps2 commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Companion to LoopKit/LoopKit#696, which removes delegateQueue and makes the delegate calls async. Needs that PR.

  • Readings used delegateQueue?.async and the delegate directly. They now go through delegate.notify like the other calls, so they reach the delegate in order with the sensor events and alerts.
  • The calls inside notify are awaited, the Task wrappers around alerts are gone, and delegateQueue is removed.
  • The test delegates record on the main actor instead of with nonisolated(unsafe).

Tested with the full LoopWorkspace test suite on the simulator (G7SensorKit 207 pass). Not run with a sensor yet.

Readings go through delegate.notify like the other calls, so they reach the delegate in
order with the sensor events and alerts.
@ps2
ps2 merged commit 8882a64 into next-dev Nov 12, 2026
yurique added a commit to Artificial-Pancreas/G7SensorKit that referenced this pull request Nov 13, 2026
…nsor re-adoption and GATT log fixes

Brings in LoopKit/G7SensorKit next-dev up to 760fe99 (the merge of LoopKit#113):
- LoopKit#113 calibration advice redesign: why/how pages, entry-page cautions,
  After You Calibrate page, advice counted as seen once the entry page is reached.
- LoopKit#115 don't adopt a failed or ended sensor again (fixes a Sensor Failed
  alarm every five minutes).
- LoopKit#117 don't crash logging a GATT error.

LoopKit#118 (async CGMManagerDelegate, drop delegateQueue) is left out: it needs
LoopKit next-dev #696, which the iAPS LoopKit dev line does not carry.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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>
@ps2
ps2 deleted the async-delegates branch December 3, 2026 06:48
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