Render unknown for a zero CreatedAt in Slack/Mattermost messages (closes #298) #300
Reference in New Issue
Block a user
Delete Branch "issue-298-zero-timestamp-fallback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #298.
FormatSlackMessage(internal/delivery/target_slack.go) rendered theTimestamp line unconditionally. When a delivery falls back to a
reaped event row (
hydrateEventleavesCreatedAtas the zero valuedeliberately, per #257),
the message carried
*Timestamp:* \0001-01-01T00:00:00Z`` --indistinguishable from the regression #257 was filed against.
Chose to render
*Timestamp:* \unknown`whenCreatedAt.IsZero(), rather than omitting the line, so the message shape stays predictable. A non-zeroCreatedAt` still renders as RFC3339, unchanged.Same code path serves Mattermost;
target_log.godoesn't renderCreatedAtso it isn't affected.Added
TestFormatSlackMessageZeroTimestampininternal/delivery/event_timestamp_test.go, asserting the zero-timecase contains no
0001-01-01and rendersunknown, and that anon-zero
CreatedAtstill renders as RFC3339.make checkgreen, including a fresh (uncached)golangci-lintrunagainst the pinned image.
Review: PASS. Zero-
CreatedAtrenders*Timestamp:* \unknown`with no0001-01-01anywhere in output; non-zero path unchanged (RFC3339/UTC). Mutation test: reverted theIsZero()guard intarget_slack.go—TestFormatSlackMessageZeroTimestampfailed exactly as expected (both assertions), confirming the test is load-bearing; source restored after.make checkgreen on the PR head, including a fresh (non-cached)golangci-lintrun, 0 issues. CI (check / check) green ond5bebb840. Merges cleanly againstnext(==main). Commit title ends(closes #298), no Claude/Anthropic references or attribution trailers anywhere. Scope check for other targets (per issue DoD item 3) confirmed:target_log.goandtarget_http.go/target_database.godon't renderevent.CreatedAt; onlytarget_slack.go` did, and it's fixed.Review: PASS. Zero-
CreatedAtrenders*Timestamp:* \unknown`with no0001-01-01anywhere in output; non-zero path unchanged (RFC3339/UTC). Mutation test: reverted theIsZero()guard intarget_slack.go—TestFormatSlackMessageZeroTimestampfailed exactly as expected (both assertions), confirming the test is load-bearing; source restored after.make checkgreen on the PR head, including a fresh (non-cached)golangci-lintrun, 0 issues. CI (check / check) green ond5bebb840. Merges cleanly againstnext(==main). Commit title ends(closes #298), no Claude/Anthropic references or attribution trailers anywhere. Scope check for other targets (per issue DoD item 3) confirmed:target_log.goandtarget_http.go/target_database.godon't renderevent.CreatedAt; onlytarget_slack.go` did, and it's fixed.