FedWiki site actions answer a failure with 200 #319

Open
opened 2026-11-02 06:23:26 +00:00 by cgalo5758 · 0 comments
Owner

What happens

When a row action on the FedWiki sites card fails, siteActionResult writes a Problem notice with status 200, and siteActionConflict (another request holds the address, or the site changed since the list rendered) does the same while setting HX-Trigger to refresh the list. docs/operator-ux-conventions.md §4 says a handler never returns a 200 with a Problem notice for a failure, because the error funnel (internal/embeds/static/error-handler.js) keys off the status; and that an error answer carries no HX- header, because htmx 4 follows those headers whatever the status.

What should happen

A failed action answers its status (409 for the conflict; the cause's 4xx or 5xx otherwise) with the notice as its body, which htmx 4 swaps into the target for a 4xx. The conflict's list refresh moves off the HX-Trigger header, for example to the sites card listening for the failed request.

Where

internal/integrations/fedwiki/web/site_actions.go: siteActionResult and siteActionConflict.

Steps

Open the sites card in two tabs; in one, make a site active; in the other, act on the same row. The second action answers 200 with a Problem notice.

Why it matters

The error funnel, the tests and the request logs read the status. A failure answered 200 reads as a success to all three, and a later change to the funnel or the swap rules would drop these notices without anyone noticing.

### What happens When a row action on the FedWiki sites card fails, `siteActionResult` writes a Problem notice with status 200, and `siteActionConflict` (another request holds the address, or the site changed since the list rendered) does the same while setting `HX-Trigger` to refresh the list. `docs/operator-ux-conventions.md` §4 says a handler never returns a 200 with a Problem notice for a failure, because the error funnel (`internal/embeds/static/error-handler.js`) keys off the status; and that an error answer carries no `HX-` header, because htmx 4 follows those headers whatever the status. ### What should happen A failed action answers its status (409 for the conflict; the cause's 4xx or 5xx otherwise) with the notice as its body, which htmx 4 swaps into the target for a 4xx. The conflict's list refresh moves off the `HX-Trigger` header, for example to the sites card listening for the failed request. ### Where `internal/integrations/fedwiki/web/site_actions.go`: `siteActionResult` and `siteActionConflict`. ### Steps Open the sites card in two tabs; in one, make a site active; in the other, act on the same row. The second action answers 200 with a Problem notice. ### Why it matters The error funnel, the tests and the request logs read the status. A failure answered 200 reads as a success to all three, and a later change to the funnel or the swap rules would drop these notices without anyone noticing.
cgalo5758 added the
kind
bug
area/fedwiki
labels 2026-11-02 06:23:26 +00:00
Sign in to join this conversation.
No labels area/fedwiki
kind
bug
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#319