Skip to content

Add configurable CGM sensor lifetime for sensor change alarm#579

Merged
marionbarker merged 3 commits intodevfrom
configurable-cgm-sensor-lifetime
Apr 10, 2026
Merged

Add configurable CGM sensor lifetime for sensor change alarm#579
marionbarker merged 3 commits intodevfrom
configurable-cgm-sensor-lifetime

Conversation

@bjorkert
Copy link
Copy Markdown
Contributor

@bjorkert bjorkert commented Mar 28, 2026

Summary

  • Add a configurable sensor lifetime setting (7–15 days, default 10) to the Sensor Change Alert, so users with 15-day G7 sensors no longer get false early alerts
  • Add unit tests for SensorAgeCondition covering both 10-day and 15-day lifetimes plus edge cases
Simulator Screenshot - iPhone 17 Pro Max - 2026-03-28 at 20 34 26

The sensor change alarm was hardcoded to a 10-day lifetime, causing
false alerts for users with 15-day G7 sensors. Add a per-alarm
sensorLifetimeDays setting (7-15 days, default 10) so users can
match their actual sensor duration.

Also fix a bug where the sensor and pump change alarms would fire
when no insert time was available (defaulting to epoch 0).
@bjorkert bjorkert self-assigned this Mar 28, 2026
@bjorkert bjorkert linked an issue Mar 29, 2026 that may be closed by this pull request
@codebymini
Copy link
Copy Markdown
Collaborator

LGTM (Except the conflicts)

Copy link
Copy Markdown
Collaborator

@codebymini codebymini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

# Conflicts:
#	Tests/AlarmConditions/Helpers.swift
@bjorkert
Copy link
Copy Markdown
Contributor Author

bjorkert commented Apr 9, 2026

Merge conflicts with dev resolved.

Copy link
Copy Markdown
Collaborator

@marionbarker marionbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a few questions.

Copy link
Copy Markdown
Collaborator

@marionbarker marionbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with updated comments and repeated test.
LGTM

@marionbarker marionbarker merged commit 01f689b into dev Apr 10, 2026
@marionbarker marionbarker deleted the configurable-cgm-sensor-lifetime branch April 10, 2026 04:25
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.

Update for G7 15 day

3 participants