Skip to content

fix(admin): a dashboard change posted without a reason is refused on its page - #683

Draft
PiquelChips wants to merge 2 commits into
mainfrom
fix/544-decision-reason-default
Draft

PiquelChips wants to merge 2 commits into
mainfrom
fix/544-decision-reason-default

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Part of #544 (NEW-7, first half).

The admin dashboard's change forms disagreed about a POST with no reason field. Most showed the page again with "Give a reason of 1 to 500 characters…", but four failed to decode the form and answered a bare 400 ("invalid form value: missing field reason"), with no page around it.

Now every form defaults a missing reason to empty, so Reason::parse refuses it on the page, exactly as it refuses a blank one.

Visible change: posting one of these changes without a reason field now answers the change's page at 400, with the reason message and the form as typed, instead of a bare decode error:

  • /handles/reserve
  • /users/{account}/handle and /users/{account}/name
  • the account's settings tabs: /users/{account}/sign-in, /profile, /emails and /apps

Browsers always send the field, since every form renders a reason input, so the change only shows for hand-made or scripted requests.

Side effect on GET: the extractor reads a GET's query as the form, so a query without a reason used to fail too. GET /handles/reserve?handle=x and GET /users/{account}/handle?handle=x (or /name?display_name=x) answered a bare 400; now they show the form, as a plain GET does. A query never changes anything.

Test: a_change_without_a_reason_is_refused_on_its_page posts with no reason to every form that used to fail decoding: /handles/reserve, the account's /handle and /name pages, and its /emails tab, which decodes through its own path (App::posted). It also posts to /handles/unreserve, whose ReasonForm already defaulted. Each answers 400 on its page with the reason message. Then the test checks that nothing changed: the handle reserved first is still listed, nothing new is reserved, and the account's handle, display name and address are as they were. With the settings tabs' default removed, the test fails.

Docs: docs/dev/architecture/surfaces.md (what a dashboard change without a reason gets) and docs/dev/extending/admin-operation.md (forms default their reason).

The follow-up refactor, stacked on this PR, folds the forms into one Administered<C> wrapper.

Note

Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)

…its page

The handle reservation, the account's settings tabs, and the handle and
display name pages failed to decode a form without a reason field, so the
dashboard answered a bare 400. Their reason now defaults to empty, as the
other forms' do, and the page asks for it again.
@PiquelChips PiquelChips added bug Something isn't working documentation Improvements or additions to documentation apps/auth-service Origin Auth at auth.sourceorigin.dev, its settings and developer console, and the operator CLI admin The admin dashboard at admin.sourceorigin.dev labels Nov 22, 2026
@PiquelChips PiquelChips added apps/auth-service Origin Auth at auth.sourceorigin.dev, its settings and developer console, and the operator CLI admin The admin dashboard at admin.sourceorigin.dev labels Nov 22, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in sourceorigin.dev Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…ered

The test now posts without a reason to the account's handle and display
name pages and its emails tab, and unreserves a handle that is reserved,
checking that nothing changes. The surfaces page says what is stored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

admin The admin dashboard at admin.sourceorigin.dev apps/auth-service Origin Auth at auth.sourceorigin.dev, its settings and developer console, and the operator CLI bug Something isn't working documentation Improvements or additions to documentation

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant