mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 21:32:18 +00:00
fix(rollups): filter deletedAt in measurement-rollup readers
`probeRollupCoverage` discovers the set of types the user has logged by selecting `DISTINCT "type" FROM measurements`. A type whose every row has been tombstoned would still surface, force the read path to demand rollup coverage for it, and silently push the request onto the live aggregator branch. Add `"deleted_at" IS NULL` so the discovery only returns types the user can still see. The rollup-read modules (`rollup-read`, `rollup-read-wmy`, `rollup-read-cumulative`) read from `measurement_rollups` which is already populated from the filtered writer in the previous commit, so they need no additional filter.
This commit is contained in:
1 parent
db2d864a8e
commit
f0a0551a80
1 file changed
+1
@@ -55,6 +55,7 @@ export async function probeRollupCoverage(
|
||||
SELECT DISTINCT "type"
|
||||
FROM measurements
|
||||
WHERE user_id = ${userId}
|
||||
AND "deleted_at" IS NULL
|
||||
) m
|
||||
LEFT JOIN measurement_rollups r
|
||||
ON r.user_id = ${userId}
|
||||
|
||||
Reference in new issue
Block a user