Skip to content

fix: don't check for disallowed words when dealing with existing user names (@fehmer)#7949

Open
fehmer wants to merge 2 commits into
masterfrom
feature/fix-username-validation
Open

fix: don't check for disallowed words when dealing with existing user names (@fehmer)#7949
fehmer wants to merge 2 commits into
masterfrom
feature/fix-username-validation

Conversation

@fehmer
Copy link
Copy Markdown
Member

@fehmer fehmer commented May 13, 2026

No description provided.

@monkeytypegeorge monkeytypegeorge added frontend User interface or web stuff packages Changes in local packages labels May 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes.

@github-actions github-actions Bot added the waiting for update Pull requests or issues that require changes/comments before continuing label May 13, 2026
@github-actions github-actions Bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label May 13, 2026
@Miodec Miodec requested a review from Copilot May 13, 2026 12:31
@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label May 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a “username without disallowed-words filter” schema and switches lookup-style UI validations (search/profile navigation) to use it, so users can interact with legacy usernames that would now fail the profanity/disallowed-words check.

Changes:

  • Add UserNameWithoutFilterSchema and refactor UserNameSchema to build on it.
  • Update profile lookup + command line profile search validation to use the unfiltered schema.
  • Remove unused isUsernameValid helper + its schema import.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/schemas/src/users.ts Introduces UserNameWithoutFilterSchema; reuses it inside UserNameSchema.
frontend/src/ts/utils/misc.ts Removes unused UserNameSchema import and isUsernameValid.
frontend/src/ts/pages/friends.ts Switches add-friend modal schema to unfiltered username validation.
frontend/src/ts/components/pages/profile/ProfileSearchPage.tsx Uses unfiltered username schema for profile lookup form validation.
frontend/src/ts/commandline/lists/navigation.ts Uses unfiltered username schema for command-line profile search validation.
Comments suppressed due to low confidence (1)

frontend/src/ts/pages/friends.ts:59

  • addFriendModal still uses Ape.users.getNameAvailability for remote validation. That endpoint’s path param schema is UserNameSchema (includes disallowed-words check), so legacy/disallowed usernames will still fail server-side validation even though the local schema was switched. For “existing user” validation, call the profile lookup endpoint (e.g. Ape.users.getProfile with isUid:false) or introduce a dedicated existence-check endpoint that uses UserNameWithoutFilterSchema.
      validation: {
        schema: UserNameWithoutFilterSchema,
        isValid: remoteValidation(
          async (name) => Ape.users.getNameAvailability({ params: { name } }),
          { check: (data) => !data.available || "Unknown user" },
        ),

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

Labels

frontend User interface or web stuff packages Changes in local packages waiting for review Pull requests that require a review before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants