Skip to content

fix(ui): allow uppercase letters in username on profile settings - #1572

Open
culfin wants to merge 1 commit into
apache:devfrom
Besser-Sehen-Landshut:fix/username-uppercase-profile
Open

fix(ui): allow uppercase letters in username on profile settings#1572
culfin wants to merge 1 commit into
apache:devfrom
Besser-Sehen-Landshut:fix/username-uppercase-profile

Conversation

@culfin

@culfin culfin commented Aug 18, 2026

Copy link
Copy Markdown

Users whose username contains an uppercase letter cannot save their profile at all — not even when they leave the username untouched, because the whole form is validated on submit.

The check in profile settings is the only one of four that rejects uppercase:

where pattern uppercase
ui/src/pages/Users/Register/components/SignUpForm/index.tsx /^[\w.-\s]{2,30}$/ allowed
ui/src/pages/Install/components/FourthStep/index.tsx /^[\w.-\s]{2,30}$/ allowed
pkg/checker/username.go ^[\w.\- ]{2,30}$ allowed
ui/src/pages/Users/Settings/Profile/index.tsx /[^a-z0-9\-._]/ rejected

So one can sign up as MaxMustermann, and from then on the profile page is locked. The error message points at the username field without saying why a name the server itself issued is suddenly invalid.

I ran into this migrating a 26-year-old forum to Answer: 3368 of 5479 accounts carry uppercase letters in names that have been in use for two decades.

Proposed Changes

  • add the ignore-case flag to the username check in profile settings, bringing it in line with registration, installation and the server
  • permits nothing the server would reject; no data or API behaviour changes

An alternative would be to reuse the exact pattern from SignUpForm, but that also allows spaces, which felt like a larger change than this fix needs. Happy to switch if you prefer the patterns to be literally identical.

The username check in profile settings is the only one that rejects
uppercase letters. Registration, installation and the server all accept
them:

  ui/src/pages/Users/Register/components/SignUpForm/index.tsx
    /^[\w.-\s]{2,30}$/          uppercase allowed
  ui/src/pages/Install/components/FourthStep/index.tsx
    /^[\w.-\s]{2,30}$/          uppercase allowed
  pkg/checker/username.go
    ^[\w.\- ]{2,30}$            uppercase allowed
  ui/src/pages/Users/Settings/Profile/index.tsx
    /[^a-z0-9\-._]/             uppercase rejected

A user who signs up as "MaxMustermann" can therefore never save their
profile, not even when leaving the username untouched, because the whole
form is validated on submit. The error message points at the username
field without explaining why a name the server issued is now invalid.

Adding the ignore-case flag brings this check in line with the other
three. It permits nothing the server would reject.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@LinkinStars
LinkinStars requested a review from robinv8 August 18, 2026 09:20
@robinv8

robinv8 commented Aug 24, 2026

Copy link
Copy Markdown

@culfin Thanks for the fix — approved. One process note: please retarget this PR to dev instead of main (rebase or merge the latest dev if needed). We land changes on dev first and only promote to main through the normal release process.

@culfin

culfin commented Aug 24, 2026

Copy link
Copy Markdown
Author

Retargeted to dev, along with the rest — thanks for the pointer, and sorry it took a few days to act on it. dev contains everything main has and none of the files these changes touch, so the diffs are unchanged.

While doing that I also consolidated: what were fourteen open pull requests are now seven. Four defects in ui/template/ became #1592, the two halves of the answer-pagination limit became #1593, and the accessibility work that had grown across five PRs is back in two (#1587, #1588). Sorry for the noise on the way there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants