Skip to content

Only let Loop purge its HealthKit glucose while eavesdropping - #95

Merged
ps2 merged 1 commit into
next-devfrom
fix/no-healthkit-purge-in-direct-mode
Oct 15, 2026
Merged

ps2 merged 1 commit into
next-devfrom
fix/no-healthkit-purge-in-direct-mode

Conversation

@ps2

@ps2 ps2 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

managedDataInterval was always 3 hours. Loop therefore deleted its own glucose samples from HealthKit after 3 hours even in direct mode. In that mode the Dexcom app isn't connected and never writes its copies, so Health was left with only the last 3 hours of readings. That matches a next-dev user's report on Zulip of glucose data disappearing from Apple Health.

It is now nil in direct mode and stays 3 hours while eavesdropping. CGMBLEKit already handles G5/G6 this way, returning 3 hours only in passive mode.

Related:

Tested: simulator build of the LoopWorkspace scheme. Not tested with a sensor.

managedDataInterval was always 3 hours, so Loop deleted its own glucose
samples from HealthKit after 3 hours even in direct mode, where the
Dexcom app isn't connected and never writes its copies. HealthKit was
left with only the last 3 hours of readings. It is now nil in direct
mode, as CGMBLEKit already does outside passive mode.
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