Repository navigation
Report pump and CGM models to analytics - #2582
Merged
Merged
Conversation
Adds Pump Model and CGM Model user properties from the managers' HKDevice.model, so analytics can tell which hardware is paired, not just which plugin. They are sent at setup and launch, and again when a status update reports a different model.
This was referenced Oct 14, 2026
ps2
added a commit
that referenced
this pull request
Oct 18, 2026
Backport of #2574, #2578 and #2582 from next-dev. - Replace the per-cycle "Loop success", "Loop error" and "CGM Fetch" events with one "Daily summary" per local day: loop success count and mean/max duration, loop error counts by issue id, the count of stored CGM readings, the day's UTC offset, and the settings state (closed loop, dosing strategy, integral retrospective correction, glucose based partial application). Running totals are kept in UserDefaults and the summary is sent on the first loop or CGM reading of the next day. - Send that settings state as user properties at launch and whenever it changes, with "Closed loop enabled change", "Dosing strategy change" and "Algorithm experiment change" events. Also send Pump Type and CGM Type at launch, and set them to "None" when the device is removed. - Send Pump Model and CGM Model user properties from the managers' HKDevice.model at setup and launch, and when a status update reports a different model. - Stop sending health data: drop bolus units and carb grams, and send only the kind of override, and its duration, not preset names, targets or sensitivity. - Send "Override Ended" when a preset is deactivated and "Settings Screen" when Settings opens. - Carb and bolus events from the phone are now in session; from the watch and remote commands they stay out of session. - Replace "Alert Issued" with "Alert Displayed": immediate alerts when issued, delayed and repeating alerts after a loop once they have come due without being retracted, and loop-not-running notifications when Loop infers their delivery. dev's glucose samples don't record backfill, so the summary counts CGM readings but has no backfill counts. The summary and state are updated on the main queue, since dev reports loops and readings from other queues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds "Pump Model" and "CGM Model" user properties beside the existing "Pump Type" and "CGM Type" (which are the plugin identifiers). The values come from
pumpManager.status.device.modelandcgmManager.cgmManagerStatus.device?.model.They are sent at launch and when a manager is set up. They are sent again only when a status update reports a different model, so the frequent pump status updates don't each produce an identify call. A missing model is reported as "Unknown", and removing the device sets the property to "None". Like the other user properties, they are only sent when the user shares usage details with developers.
Several plugins currently report a missing, hard-coded, or localized model, or don't send status updates when it changes. Those fixes belong in the plugins, so they are not part of this PR.
Tested: simulator build of the Loop scheme.