mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
The runtime accepts "+05:30" as a zone id, so isValidTimezone let it through, but Postgres reads a bare offset in AT TIME ZONE with the POSIX sign (east of UTC is negative), and the day-grain SQL aggregates would cut every day on the wrong side of UTC. isValidTimezone now accepts named zones only: whatever the runtime resolves to a bare offset is refused, while named zones, their aliases, UTC and the Etc/GMT family stay accepted. Every write that already validated through it refuses offsets now, and the screener and mood linked-context request schemas validate their zone too. A value stored before this change can still sit in the database, so the SQL call sites that read the stored zone directly (the dashboard summary, achievements, the doctor report, the tiered AI context) fall back rather than splice it, as the resolver and the day aggregates already did.