Skip to content

Record G7 states without reliable glucose as sensorIssue events - #90

Merged
ps2 merged 1 commit into
next-devfrom
g7-sensor-issue
Oct 12, 2026
Merged

ps2 merged 1 commit into
next-devfrom
g7-sensor-issue

Conversation

@ps2

@ps2 ps2 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Replaces #84 (@bjorkert), using the sensorIssue event type from LoopKit/LoopKit#637. Merge that first.

  • On each reading, records a sensorIssue event when the algorithm state changes to one without reliable glucose, under the sensor's serial. error.code is the state name, and isFatal is set for failures.
  • The last reported state is kept in G7CGMManagerState, so it survives relaunches. A reliable reading or a new sensor clears it.
  • A failure is recorded just before the sensorEnd.
  • Each event is dated from the reading's own timestamp.

Tests: once per state change, a failure is fatal and comes before sensorEnd, and a new sensor starts over.

Each state is recorded once while it lasts, with the algorithm state's
name as the code and isFatal for sensor failures. A reliable reading or
a new sensor clears it, so a state that returns is recorded again. The
last state is kept in the manager state, so a relaunch stays quiet. A
failure is recorded before the sensorEnd that closes the session.

Ports #84 to next-dev, keeping the bookkeeping in
the manager instead of a shared LoopKit reporter.

Co-authored-by: Jonas Björkert <jonas@bjorkert.se>
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