mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
Every day-key derivation feeding the achievement streak/count badges (login, entry, weekend, miss-free, sleep-log, on-time, compliance-80) plus the hidden night-owl/early-bird triggers hardcoded Europe/Berlin, including the SQL vitals-bucket query's `AT TIME ZONE` literal. A non-CET user's evening entries could fold into the wrong calendar day, or two genuinely distinct local days could merge into one, silently breaking streak badges for every non-CET account. Threads the account's own `User.timezone` through `buildAchievementsResult` into the SQL query (bound as a parameter, not spliced — Postgres accepts a text value on the right side of `AT TIME ZONE`, verified against a live instance) and every JS-side day-key helper. The pure helpers in `expansion-metrics.ts` and `care-metrics.ts` keep the Berlin default when `tz` is omitted, so every existing caller/fixture is unaffected.