You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(apiv2): name the reason when a validation failure has one field error - #3992
Closes#3991
Related issue: #3990 (closed as a duplicate; its form requirements are carried on #3991)
Validation tasks: none
Creating an account on the web sign-up page with a 7-character password, or with a wrong invite code, shows only "The request did not pass validation; see errors." The page never says which field was refused or why.
The server sends the reason, but only in the problem's errors array. Its top-level detail is a fixed summary for every validation failure built only from field errors, and English clients show detail. Any English client that follows the contract shows the same summary on any form that fails this way.
Approach
When a validation_failed problem carries that fixed summary and exactly one field error, the server now sends the field error's detail as the problem's detail. This happens where problems are rendered, so it covers Huma's schema failures and the hand-built problems alike. With several field errors, detail stays the summary. errors is unchanged, and so is translation, which keys on type and field code. The contract's Problem Details section states the rule, and the API docs' single-error examples match it.
The web sign-up form now validates field by field. Create account stays disabled until every field is valid: a username, a valid email, a password of 8 characters to 72 bytes (the rule newPasswordProblem already applies on the password-reset pages), a matching confirmation, and an invite code. Each rule shows under its field once the user has typed in or left it, never on a freshly loaded form, using existing translated strings. When the server still refuses the request, as with a wrong invite code, each field error shows under the field its location names; a toast is left only for errors no field takes. The fields are locked while the request is out, so a refusal can't land on a value typed since. The setup wizard's account step runs the same password length check before sending.
The request editors' error box printed the problem message and any field errors it couldn't place beside a field. Now that the message can equal a field error, the box skips the message when it already shows the same text.
Sign-up is web-only. The Android sign-up screen already checks the length first, and the Apple apps have no sign-up screen. No Apple or Android source compares against the summary text; Apple's request screens map validation_failed by type. jellycompat is unaffected: it doesn't use v2 problems and keeps its own error responses.
Validation
Reproduced on a dev deployment built from main (ab8258fe): both the 7-character password and the wrong invite code showed only the summary toast. On a build of e608fcdb, a fresh form shows no rules and a disabled button; a 7-character password shows its rule under the field and nothing is sent, Enter included; a mismatch shows under the confirm field; a wrong invite code shows "Invalid invite code" under that field. With every field valid, the account is created and the browser opens Home. Checked at iPad and phone widths.
API on the fix build: a single field error is now the detail; a request with two field errors keeps the summary.
TestContractFixtures compares the router's output byte for byte with the committed fixtures. The 140 regenerated fixtures fail against the unfixed code (140 stale) and pass on the fix. go test ./internal/apiv2/ and the fixture schema check pass.
The detail text of single-field validation failures changes on every /api/v2 route. The contract says clients never parse detail. A client that shows detail in a banner and the field error beside its field will now show the same sentence twice. The web's request editors were the only such place found, and this PR handles them. The 140 contract fixtures change by one line each. The copies vendored in silo-apple and silo-android are pinned snapshots, so they keep the old text until their next refresh.
For a Huma schema failure, the promoted text is Huma's own message, such as "expected length >= 8". That names the limit but not the field. The web avoids it for passwords by checking first.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or says there is none.
AI Disclosure
Harness: Claude Code in T3 Code
Tool(s): Claude Code, T3 preview browser, a disposable test deployment, Codex (plan review)
Model(s): claude-opus-5-5 (implementation, plan cut, code review), gpt-6.1-sol (plan attack)
Involvement: AI-assisted
Adversarial review: Plan round before implementation. gpt-6.1-sol attacked the plan: it made fixture regeneration mandatory, found the request editors' duplicate message, and dropped an unneeded dedupe in the libraries hook. claude-opus-5-5 cut it down: it dropped a rewrite of Huma's length messages and a standalone Go test, since the regenerated fixtures pin the behavior. A simplify pass changed nothing. A high-level multi-agent code review (claude-opus-5-5 and claude-sonnet finders) found that the editors' dedupe could hide the only error when the field it matched has no control on screen; it now dedupes only against text in the same box. It also found the contract sentence overstated the rule, which is now reworded. The background adversarial review (gpt-6.1-sol, reviewed b921939) found that sign-up did not yet meet the form requirements carried on [bug] Sign-up hides why a password or invite code was refused #3991 (disabled button, errors under fields, server errors placed by field); the sign-up form commit implements them, with a simplify pass that derived the field type from its list.
…rror
A validation failure set its detail to "The request did not pass
validation; see errors." and put the reason only in errors[]. English
clients show the detail, so web sign-up answered a short password or a
wrong invite code with that sentence alone.
The problem renderer now copies the sole field error's detail into the
detail. Several field errors keep the summary. Sign-up and the setup
wizard check the password length before sending, and the request editors
don't print a message twice in their error box.
Closes#3991
Co-Authored-By: Claude Opus 5.5 <[email protected]>
No actionable comments were generated in the recent review.
Walkthrough
The API promotes a sole nonempty field-error detail into the validation problem summary. Fixtures and documentation show specific validation details. Signup and setup forms validate passwords, and signup displays client and server field errors. Admin request editors suppress duplicate error summaries.
Changes: Validation detail handling
Layer / File(s)
Summary
API problem detail selection internal/apiv2/problem.go
Both problem-writing paths use a shared validation summary and promote a sole nonempty field-error detail to the top-level detail.
Validation fixtures and documentation contracts/api/v2/fixtures/*, docs/architecture/api-contract.md, docs/downloads-api.md, docs/settings-api.md
Fixtures and examples show specific validation details. The API contract documentation describes when the problem detail uses the single field error’s detail.
Signup and setup password validation web/src/lib/newPassword.ts, web/src/pages/Signup.tsx, web/src/pages/Signup.test.tsx, web/src/pages/setup-wizard/steps/AccountStep.tsx
Signup validates fields, maps server field errors to inputs, and disables submission for invalid values. The setup account step checks password rules before submitting. Tests cover invalid and valid signup cases.
Admin form error display web/src/pages/admin-settings/RequestRuleEditor.tsx, web/src/pages/admin-settings/RequestServers.tsx
Admin request editors omit a form summary when its text matches an unplaced field error. They continue to display unplaced errors.
The change makes validation messages more specific for API responses and the web sign-up form. No merge-blocking risk is identified in the reviewed evidence.
Security architecture risk: Low · up to 13e04
The inspected changes preserve server-controlled signup and authentication while making validation failures more specific. No introduced security weakness was identified, but downstream use of the changed error text was only partially checked.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
observed — The behavior applies through both the Huma transformer and direct problem writer, so exposure is broader than signup alone. An inspected password-refusal fixture changes only the top-level detail to duplicate text already present in its errors array.
Security Findings and Attack Paths
inferred — On the inspected paths, the PR makes existing refusal information more visible without adding a credential-disclosure source or expanding signup authority. This conclusion does not establish the safety of every field-error producer or downstream consumer.
Trust Boundaries and Controls
observed — Signup validation remains a client-side preflight rather than an authorization decision. It checks invite-code presence, sends the original value to the server, and displays authoritative server refusals. Authentication state continues to derive from the server's returned token pair.
Resilience and Maintainability Implications
observed — The observation hook called after promotion records only the problem type identifier, not the more specific detail. The inspected direct writer also retains application/problem+json and no-store response headers.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title clearly identifies the main API v2 change: promoting the sole field error to the validation failure detail.
Linked Issues check
Issue #3991 requires the web sign-up page to explain short-password and invalid-invite-code failures. Signup.tsx adds client validation for password length and field-level error rendering. It maps s…
Out of Scope Changes check
The API problem change, contract documentation, fixtures, and sign-up tests support issue #3991 by exposing and verifying the specific validation message. The setup-wizard password check applies the s…
Description check
The description directly explains the API validation-detail changes, web sign-up validation behavior, related editor updates, tests, risks, and linked issue objectives.
Full details: Linked Issues check
Explanation
Issue #3991 requires the web sign-up page to explain short-password and invalid-invite-code failures. Signup.tsx adds client validation for password length and field-level error rendering. It maps server body.* errors to the related fields, including invite-code errors. Signup.test.tsx covers initial state, password limits, invite-code errors, blocked invalid submissions, pending locking, and successful signup. newPasswordLengthProblem also covers the setup wizard account step. The API promotes a sole field error to detail, which supplies the field message used by the web client.
Full details: Out of Scope Changes check
Explanation
The API problem change, contract documentation, fixtures, and sign-up tests support issue #3991 by exposing and verifying the specific validation message. The setup-wizard password check applies the same account password rule. Request-editor deduplication prevents duplicate text caused by the API contract change. The reviewed changes do not demonstrate an unrelated product change.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: a01bb24e-034b-41e2-9876-e427bd79ac6c
Commits
Reviewing files that changed from the base of the PR and between e608fcd and 13e0491.
Files selected for processing: 2
web/src/pages/Signup.test.tsx
web/src/pages/Signup.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
One verified finding below. Focused API validation and contract-fixture tests passed. The v1.0 validation board could not be checked because the available token lacks read:project.
Create account stays disabled until every field is valid: a username,
a valid email, a password of 8 characters to 72 bytes, a matching
confirmation, and an invite code. Each rule shows under its field once
the user has typed in or left it, instead of in a toast. A refusal from
the server, such as a wrong invite code, shows under the field its
location names; the toast is only for errors no field takes.
Refs #3991
Co-Authored-By: Claude Opus 5.5 <[email protected]>
silo-triageBot
added
size/XL
500–999 added + deleted lines (all files); change volume, not priority.
and removed
size/L
200–499 added + deleted lines (all files); change volume, not priority.
labels
Nov 11, 2026
A refusal for one submission could land under a field the user had
edited since. The fields are now disabled until the request settles.
Refs #3991
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: fce3dd79-c824-4a43-8ee6-814943d54031
Commits
Reviewing files that changed from the base of the PR and between b921939 and e608fcd.
Files selected for processing: 3
web/src/lib/newPassword.ts
web/src/pages/Signup.test.tsx
web/src/pages/Signup.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
coderabbitaiBot
added
api-v2
API v2 / Huma migration program (epic #135); long-running, stacked by phase
bug
Something isn't working
go
Pull requests that update go code
javascript
Pull requests that update javascript code
labels
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api-v2API v2 / Huma migration program (epic #135); long-running, stacked by phasebugSomething isn't workinggoPull requests that update go codejavascriptPull requests that update javascript codesize/XL500–999 added + deleted lines (all files); change volume, not priority.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #3991
Related issue: #3990 (closed as a duplicate; its form requirements are carried on #3991)
Validation tasks: none
Creating an account on the web sign-up page with a 7-character password, or with a wrong invite code, shows only "The request did not pass validation; see errors." The page never says which field was refused or why.
The server sends the reason, but only in the problem's
errorsarray. Its top-leveldetailis a fixed summary for every validation failure built only from field errors, and English clients showdetail. Any English client that follows the contract shows the same summary on any form that fails this way.Approach
When a
validation_failedproblem carries that fixed summary and exactly one field error, the server now sends the field error'sdetailas the problem'sdetail. This happens where problems are rendered, so it covers Huma's schema failures and the hand-built problems alike. With several field errors,detailstays the summary.errorsis unchanged, and so is translation, which keys on type and field code. The contract's Problem Details section states the rule, and the API docs' single-error examples match it.The web sign-up form now validates field by field. Create account stays disabled until every field is valid: a username, a valid email, a password of 8 characters to 72 bytes (the rule
newPasswordProblemalready applies on the password-reset pages), a matching confirmation, and an invite code. Each rule shows under its field once the user has typed in or left it, never on a freshly loaded form, using existing translated strings. When the server still refuses the request, as with a wrong invite code, each field error shows under the field itslocationnames; a toast is left only for errors no field takes. The fields are locked while the request is out, so a refusal can't land on a value typed since. The setup wizard's account step runs the same password length check before sending.The request editors' error box printed the problem message and any field errors it couldn't place beside a field. Now that the message can equal a field error, the box skips the message when it already shows the same text.
Sign-up is web-only. The Android sign-up screen already checks the length first, and the Apple apps have no sign-up screen. No Apple or Android source compares against the summary text; Apple's request screens map
validation_failedby type. jellycompat is unaffected: it doesn't use v2 problems and keeps its own error responses.Validation
main(ab8258fe): both the 7-character password and the wrong invite code showed only the summary toast. On a build ofe608fcdb, a fresh form shows no rules and a disabled button; a 7-character password shows its rule under the field and nothing is sent, Enter included; a mismatch shows under the confirm field; a wrong invite code shows "Invalid invite code" under that field. With every field valid, the account is created and the browser opens Home. Checked at iPad and phone widths.detail; a request with two field errors keeps the summary.TestContractFixturescompares the router's output byte for byte with the committed fixtures. The 140 regenerated fixtures fail against the unfixed code (140 stale) and pass on the fix.go test ./internal/apiv2/and the fixture schema check pass.make lint-changed: no issues. Web prettier, eslint andtscare clean, and the vitest suites forsrc/pages,src/libandsrc/api/v2pass under Node 24.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/issue-3991/
Risks
The
detailtext of single-field validation failures changes on every/api/v2route. The contract says clients never parsedetail. A client that showsdetailin a banner and the field error beside its field will now show the same sentence twice. The web's request editors were the only such place found, and this PR handles them. The 140 contract fixtures change by one line each. The copies vendored in silo-apple and silo-android are pinned snapshots, so they keep the old text until their next refresh.For a Huma schema failure, the promoted text is Huma's own message, such as "expected length >= 8". That names the limit but not the field. The web avoids it for passwords by checking first.
Checklist
AI Disclosure
🤖 Generated with Claude Code