What problem does this solve?
HealthSyncService only ever writes. Read authorization covers just the four profile characteristics behind the "import profile" button.
That closes off continuous glucose entirely. A CGM writes bloodGlucose to Health; PulseLoop can't see it. Oura's whole metabolic-health story is exactly this read — and once the data is in, it sits in the same store the coach already queries, beside the ring's sleep and heart rate.
Proposed solution
Read glucose and body mass, behind an opt-in that is separate from the export master toggle. "Show my ring data elsewhere" and "let other apps' data into mine" are different decisions with different privacy weight; one switch would make one of them implicit.
The loop guard is the part that needs care. With #113 merged PulseLoop exports glucose and would import it, so unguarded one reading goes round forever: import → export as ours → import back. It should be guarded on both sides, because they fail differently:
- every read excludes this app's own
HKSource;
- imported rows carry their own
MeasurementSource, which the export predicates exclude.
Body mass should update the profile rather than becoming a measurement row — that's where the calorie model and BMI already read weight from.
Steps and workouts should not be imported. Both double-count against ring data: Health's step count includes the iPhone's pedometer, and a ring workout PulseLoop exported would return as a second session. That needs provenance-aware reconciliation, and it's better to decline than to pretend.
Import watermarks want to be a separate map from the export ones, so a full re-export never also re-imports a year of glucose.
Depends on
Apple Health export completion (#113) — the loop guard exists because that PR starts exporting glucose.
Area
Apple Health integration
What problem does this solve?
HealthSyncServiceonly ever writes. Read authorization covers just the four profile characteristics behind the "import profile" button.That closes off continuous glucose entirely. A CGM writes
bloodGlucoseto Health; PulseLoop can't see it. Oura's whole metabolic-health story is exactly this read — and once the data is in, it sits in the same store the coach already queries, beside the ring's sleep and heart rate.Proposed solution
Read glucose and body mass, behind an opt-in that is separate from the export master toggle. "Show my ring data elsewhere" and "let other apps' data into mine" are different decisions with different privacy weight; one switch would make one of them implicit.
The loop guard is the part that needs care. With #113 merged PulseLoop exports glucose and would import it, so unguarded one reading goes round forever: import → export as ours → import back. It should be guarded on both sides, because they fail differently:
HKSource;MeasurementSource, which the export predicates exclude.Body mass should update the profile rather than becoming a measurement row — that's where the calorie model and BMI already read weight from.
Steps and workouts should not be imported. Both double-count against ring data: Health's step count includes the iPhone's pedometer, and a ring workout PulseLoop exported would return as a second session. That needs provenance-aware reconciliation, and it's better to decline than to pretend.
Import watermarks want to be a separate map from the export ones, so a full re-export never also re-imports a year of glucose.
Depends on
Apple Health export completion (#113) — the loop guard exists because that PR starts exporting glucose.
Area
Apple Health integration