Files
HealthLog/tests/integration
Marc-André Bombeck 9c29fd1121 fix(insights): cap bulk measurement reads per type so a dense stream cannot starve sparse ones
The bulk measurement reads behind the insight features, the Coach snapshot
timelines, the mood cross-metric pairing, the correlation windows and the
weight and blood pressure status cards read newest-first across all their
types under a single row cap. On an account with a wearable heart rate
stream the cap filled within hours, and every weight, blood pressure or
other sparse reading fell out of the read, so blocks reported no data for
metrics with years of it.

All of them now go through one read that descends the live partial index
once per type, each type stopping at its own cap. The feature extraction
and the Coach snapshot cap each type at 6000, so a block built from one
type's read equals the block the full read builds (worst case 72,000 rows
for the twelve feature types). The mood, correlation and status reads keep
their old totals and share them fairly: each type keeps at least its share,
a sparse one all of its window.

The feature context's data span now comes from index probes over every
type in the window rather than from the capped rows, and its measurement
count is the readings the blocks were built from.

Refs #1398
2026-11-16 08:05:00 +01:00
..