fix: local timezone for replies + quiet-hours; guard presence "ago" overflow
Timezone: the container ran in UTC, so mavend answered clock/date queries (voice.go replySystem) and evaluated quiet-hours (gather.go) in UTC. Fixed at the root — process TZ — rather than per-call: TZ=Europe/Samara in compose + tzdata in the image (debian-slim strips it, without which Go ignores TZ and stays UTC). One knob fixes replies and quiet-hours for every daemon; change the zone in compose. Overflow: the dash "ago" helper ran time.Since on a zero timestamp (no presence yet / fresh db), saturating to ~292y and rendering "2562047h47m…". Guard zero → "never". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+8
-1
@@ -50,7 +50,14 @@ var dashHTML string
|
||||
// text in facts/nudges. Read-only: browses the append-only store via CoreAPI,
|
||||
// never writes — the store IS the audit trail, this just shows it.
|
||||
var dashTmpl = template.Must(template.New("dash").Funcs(template.FuncMap{
|
||||
"ago": func(t time.Time) string { return time.Since(t).Round(time.Second).String() + " ago" },
|
||||
"ago": func(t time.Time) string {
|
||||
// A zero timestamp (no presence signal yet, fresh DB) would make
|
||||
// time.Since saturate to ~292y (MaxInt64) and render as garbage.
|
||||
if t.IsZero() {
|
||||
return "never"
|
||||
}
|
||||
return time.Since(t).Round(time.Second).String() + " ago"
|
||||
},
|
||||
}).Parse(dashHTML))
|
||||
|
||||
func noCache(h http.Handler) http.Handler {
|
||||
|
||||
Reference in New Issue
Block a user