mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 21:32:18 +00:00
Wire the silent intake-sync push into both intake writers. The single route fires once for the affected slot after the row is persisted; the bulk route collects the distinct (medicationId, scheduledFor) slots whose state actually changed and fires one push per slot, so a 500-row backfill wakes a device per affected slot rather than per row. Pending echoes, duplicates, and no-downgrade no-ops change nothing visible and are excluded. Both pass the originating device through the X-Device-Id header so the device that recorded the dose is skipped. The dispatch is best-effort and fire-and-forget: the canonical rows are already written, so a push miss never affects the response.