Render unknown for a zero CreatedAt in Slack/Mattermost messages (closes #298)
All checks were successful
check / check (push) Successful in 3m9s

FormatSlackMessage rendered the Timestamp line unconditionally, so a
reaped-row fallback delivery carried "0001-01-01T00:00:00Z" -- the
exact string #257 was filed
against, indistinguishable from that regression. When
event.CreatedAt.IsZero(), render "unknown" instead; a real CreatedAt
still renders as RFC3339.
This commit is contained in:
2026-08-24 15:46:50 +00:00
parent 5976a4a98f
commit d5bebb8408
2 changed files with 41 additions and 1 deletions

View File

@@ -231,10 +231,15 @@ func FormatSlackMessage(
event.ContentType,
)
timestamp := "unknown"
if !event.CreatedAt.IsZero() {
timestamp = event.CreatedAt.UTC().Format(time.RFC3339)
}
fmt.Fprintf(
&b,
"*Timestamp:* `%s`\n",
event.CreatedAt.UTC().Format(time.RFC3339),
timestamp,
)
fmt.Fprintf(