Event log: show only the events with a failed or a pending delivery (closes #390)
check / check (push) Successful in 3m18s

The event log had no way to list only the events whose delivery failed, and once it showed only the 50 newest, an older failure could not be found at all. It now has All, Failed (N) and Pending (N) links, carried in a `show` query parameter, so they work without the page's script library. Each filtered list keeps the 50-row limit and newest-first order, and lists an event once. It finds matching deliveries through `idx_deliveries_status` and looks their events up by ID, so its cost follows the matches, not the webhook's size. Replay returns to the list it was pressed in. The heading line says what a filter counts.

Model: opus-5-5
This commit was merged in pull request #490.
This commit is contained in:
2026-10-03 05:40:34 +02:00
parent 9079a3219d
commit 7e779f7fce
13 changed files with 484 additions and 44 deletions
+14 -4
View File
@@ -329,15 +329,25 @@ func replayBody(body string) *string {
}
// redirectToEventLog redirects a replay or resubmit back to the event
// log it was triggered from, carrying the outcome as its notice.
// log it was triggered from, carrying the outcome as its notice. A
// Replay form carries the list it was pressed in as show, so a replay
// returns to the Failed or Pending list; a Resubmit form carries none,
// so a resubmit returns to the full log, where its new event is the
// newest.
func redirectToEventLog(
w http.ResponseWriter,
r *http.Request,
webhook database.Webhook,
code noticeCode,
) {
http.Redirect(
w, r, withNotice("/hook/"+webhook.ID+"/events", code),
http.StatusSeeOther,
location := withNotice("/hook/"+webhook.ID+"/events", code)
show := r.PostFormValue(showParam)
if eventLogStatuses(show) != nil {
location += "&" + showParam + "=" + show
}
http.Redirect( //nolint:gosec // show is checked by eventLogStatuses
w, r, location, http.StatusSeeOther,
)
}