Problem
SessionStore.DailyTotal() in internal/metrics/session.go:178 computes "today" as:
today := time.Now().Truncate(24 * time.Hour)
This truncates to UTC midnight, not local midnight. For users in non-UTC timezones, sessions started after local midnight but before UTC midnight are excluded from the daily total (or vice versa).
Example
User in UTC-8 (PST) at 5 PM local time (01:00 UTC next day). A session started at 9 AM local (17:00 UTC) has StartedAt.After(today) comparing against UTC midnight. The boundary is wrong by up to 12 hours.
Suggested Fix
now := time.Now()
today := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
Files
internal/metrics/session.go:174-186
Problem
SessionStore.DailyTotal()ininternal/metrics/session.go:178computes "today" as:This truncates to UTC midnight, not local midnight. For users in non-UTC timezones, sessions started after local midnight but before UTC midnight are excluded from the daily total (or vice versa).
Example
User in UTC-8 (PST) at 5 PM local time (01:00 UTC next day). A session started at 9 AM local (17:00 UTC) has
StartedAt.After(today)comparing against UTC midnight. The boundary is wrong by up to 12 hours.Suggested Fix
Files
internal/metrics/session.go:174-186