Files
vitareba/app/api/checkin
g-butandClaude Sonnet 4.6 3033c4f8c9 fix(streak): extend history window to 110 days for accurate streak counts
The 60-day window capped computeStreak() at 60, meaning:
- The 100-day milestone email in the checkin API would never fire
  (streak appeared as 60, not 100, to the milestone check)
- The reminder email subject showed "60-day streak" for patients
  whose actual streak exceeded 60 days
- The dashboard displayed the wrong streak count for 60+ day streaks

Fix: raise the history window to 110 days across all three places
(checkin API milestone helper, checkin-reminder cron, dashboard).
Derived from max(CHECKIN_STREAK_MILESTONES) + buffer = 100 + 10.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:11:03 +02:00
..