Skip to content

Count backfilled glucose in the daily analytics summary - #2575

Merged
ps2 merged 1 commit into
analytics-daily-summary-and-privacyfrom
glucose-backfill-analytics
Oct 14, 2026
Merged

ps2 merged 1 commit into
analytics-daily-summary-and-privacyfrom
glucose-backfill-analytics

Conversation

@ps2

@ps2 ps2 commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #2574. It needs LoopKit/LoopKit#646 for StoredGlucoseSample.isBackfill and receivedDate.

The daily summary's cgmFetchCount only counted readings fetched by polling. CGMs that push readings, through the cgmManager(_:hasNew:) path, were never counted. It's replaced by counts of CGM readings actually stored, taken from what addGlucoseSamples returns. Duplicates the store drops aren't counted.

  • glucoseCount: CGM readings stored that day (user-entered readings excluded)
  • backfillCount: how many of those were tagged backfill by the CGM plugin
  • maxBackfillAgeMinutes: the longest gap between a backfilled reading's time and when Loop received it

The per-fetch "CGM Fetch" hook is removed.

Plugin PRs that set the tag:

Uploaders:

Tested by building the LoopWorkspace scheme with all of the above.

The daily summary replaces cgmFetchCount, which only counted readings fetched by polling and missed CGMs that push readings, with counts of CGM readings actually stored: glucoseCount, backfillCount, and maxBackfillAgeMinutes (the longest gap between a backfilled reading's time and when Loop received it).
@ps2

ps2 commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

This merged into the stacked base branch after #2574 was squash-merged, so it didn't reach next-dev. Re-opened against next-dev as #2578.

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