mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 04:32:42 +00:00
Swaps `/api/medications/intake?scope=compliance` onto the rollup reader behind a coverage probe — a user with intake events but no rollup rows still gets a correct response from the legacy live aggregator and triggers the boot backfill in the background so the next request lands on the rollup path. Every write site that mutates `MedicationIntakeEvent` (POST + PUT + DELETE + per-medication import, bulk batch, telegram callbacks, external API ingest, admin restore) now fires `recomputeMedicationComplianceForEvent` for the affected user-day. Bulk + import collapse the per-row hooks to one recompute per distinct `(medicationId, dayKey)` so a 500-row ingest still costs a bounded fold. Purge wipes the rollup partition alongside the intake-event deleteMany. Eliminates the 3.2 s cold mount the v1.4.38 perf analysis attributed to the unbounded event findMany.