Event log: show attempt and delivery times, label replays, zone event times (closes #386)
check / check (push) Successful in 3m21s

In the event log and on an event's page, attempts and deliveries showed no time, event times had no zone, and a replay looked like the original it repeated. Each attempt now shows when its result was recorded and each delivery when it was created, as how long ago with the full UTC time on hover, and the event log's event times read the same way. A delivery created by Replay records it in a new `replay` column and is labelled a replay in the event's summary line and its delivery list; replays made before this change are not labelled. A delivery's row is now drawn by one template, `delivery_row`, that both pages share.

Model: opus-5-5
This commit was merged in pull request #487.
This commit is contained in:
2026-10-03 04:12:27 +02:00
parent ea8384f4a2
commit d8c60c9b67
14 changed files with 181 additions and 28 deletions
+13
View File
@@ -11,6 +11,7 @@ import (
"strings"
"time"
"github.com/dustin/go-humanize"
"github.com/go-chi/chi"
"github.com/google/uuid"
"gorm.io/gorm"
@@ -95,6 +96,14 @@ type DeliveryView struct {
Status database.DeliveryStatus
Target delivery.TargetView
// Replay is set on a delivery the Replay action created.
Replay bool
// Created is how long ago the delivery was created, and
// CreatedUTC the full timestamp the page shows on hover.
Created string
CreatedUTC string
// Results is this delivery's attempts in attempt order,
// bounded by maxRenderedAttempts. Without them a failure
// renders as the status word alone and says nothing about
@@ -1410,6 +1419,7 @@ func (h *Handlers) newDeliveryViews(
for i := range deliveries {
target := targetMap[deliveries[i].TargetID]
rows := attempts[deliveries[i].ID]
created := deliveries[i].CreatedAt
results, omitted := renderedAttempts(
rows, target.Redactor,
@@ -1419,6 +1429,9 @@ func (h *Handlers) newDeliveryViews(
ID: deliveries[i].ID,
Status: deliveries[i].Status,
Target: target.View,
Replay: deliveries[i].Replay,
Created: humanize.Time(created),
CreatedUTC: created.UTC().Format(time.DateTime) + " UTC",
Results: results,
AttemptCount: len(rows),
AttemptsOmitted: omitted,