SIGN IN SIGN UP

fix(realtime): stamp comment:created broadcasts with the real UTC offset (#7523)

The three comment:created payloads published from TaskService (agent
replies, delegated failure recovery, recovery exhaustion) formatted
created_at with Format("2006-01-02T15:04:05Z"). The trailing "Z" there is
a literal, not Go's Z07:00 offset token, and pgx decodes timestamptz into
the process location (no ScanLocation is configured) — so a deployment
whose server process TZ is not UTC published local wall-clock digits under
a UTC label.

Clients place the entry a whole offset away from its real instant, then
move it again once a refetch replaces the value with the REST rendering,
which uses util.TimestampToString. The web timeline sorts these strings
directly (sortTimelineEntriesAsc), so the two formats also break its
ordering key.

Render all three through util.TimestampToString — the same helper the REST
CommentResponse uses — via one shared commentEventFields renderer, so a
comment's created_at is byte-identical over WS and over HTTP. On a UTC
process the output is unchanged.

Also fixes a latent case: the old format rendered an unset timestamp as
0001-01-01T00:00:00Z, which would sort to the top of every timeline.
util.TimestampToString returns "" instead.

Co-authored-by: J <agent@multica.ai>
Co-authored-by: multica-agent <github@multica.ai>
B
Bohan Jiang committed
3881f6589f438f14702c85013ba9fb086eafe995
Parent: da7131a
Committed by GitHub <noreply@github.com> on 8/25/2026, 4:54:00 AM