Target and webhook edit pages lose what was typed when a save is rejected #381

Open
opened 2026-10-01 22:04:46 +02:00 by clawbot · 0 comments
Collaborator

Owner's request, #377 (chat, 2026-10-01):

audit the whole app for stupid cases of missing functionality or basic things like this (like the stats panel at the top that i requested).

What is wrong:

  • Target edit page (templates/target_edit.html; applyTargetEdit in internal/handlers/target_edit.go, which calls buildTargetConfig in internal/handlers/source_management.go). Any rejected save answers with a bare text page, for example "Invalid timeout: timeout is out of range: at most 300 seconds". Causes include an empty name, a timeout over 300, a refused header, a refused destination and a bad archive expiry. The form is gone, every change typed into it is lost, and there is no link back. The page already has an error slot (renderTargetEdit takes a message), but these paths do not use it.
  • Webhook edit page (templates/source_edit.html, applyWebhookEdit). A rejected save shows its error in the form, but the form comes back with the stored name, description and retention. In the audit, a description typed alongside an empty name was lost.

#370 covers the same problem in the add-target form, and #373 covers it on the new-webhook page. This issue covers the two edit pages.

Definition of done:

  • A rejected save on the target edit page renders the edit form again, with the error shown above it and every submitted value kept: name, URL, headers, timeout, retries and expiry. The status code is the same as today.
  • A rejected save on the webhook edit page keeps the submitted name, description and retention.
  • Neither edit path answers a validation failure with plain text any more.
  • Tests: for each target type, a rejected edit renders the form with the error and the submitted values; the same for the webhook edit form.

PRIORITY: from the owner's audit request of 1 October (#377), in the tier of #367 to #376.

Model: opus-5-5

Owner's request, https://git.eeqj.de/sneak/webhooker/issues/377 (chat, 2026-10-01): > audit the whole app for stupid cases of missing functionality or basic things like this (like the stats panel at the top that i requested). What is wrong: - **Target edit page** (`templates/target_edit.html`; `applyTargetEdit` in `internal/handlers/target_edit.go`, which calls `buildTargetConfig` in `internal/handlers/source_management.go`). Any rejected save answers with a bare text page, for example "Invalid timeout: timeout is out of range: at most 300 seconds". Causes include an empty name, a timeout over 300, a refused header, a refused destination and a bad archive expiry. The form is gone, every change typed into it is lost, and there is no link back. The page already has an error slot (`renderTargetEdit` takes a message), but these paths do not use it. - **Webhook edit page** (`templates/source_edit.html`, `applyWebhookEdit`). A rejected save shows its error in the form, but the form comes back with the stored name, description and retention. In the audit, a description typed alongside an empty name was lost. https://git.eeqj.de/sneak/webhooker/issues/370 covers the same problem in the add-target form, and https://git.eeqj.de/sneak/webhooker/issues/373 covers it on the new-webhook page. This issue covers the two edit pages. Definition of done: - A rejected save on the target edit page renders the edit form again, with the error shown above it and every submitted value kept: name, URL, headers, timeout, retries and expiry. The status code is the same as today. - A rejected save on the webhook edit page keeps the submitted name, description and retention. - Neither edit path answers a validation failure with plain text any more. - Tests: for each target type, a rejected edit renders the form with the error and the submitted values; the same for the webhook edit form. PRIORITY: from the owner's audit request of 1 October (https://git.eeqj.de/sneak/webhooker/issues/377), in the tier of https://git.eeqj.de/sneak/webhooker/issues/367 to https://git.eeqj.de/sneak/webhooker/issues/376. Model: opus-5-5
clawbot self-assigned this 2026-10-01 22:04:46 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#381