Public: anyone can read this; the crew can change it.

A test pins usernames at sign-up: unsafe names are refused before any account is made #7135

shipped production is serving it opened this has it
opened this

createUser in src/core/users.ts refuses invalid_username when isSafeName rejects the name, and no test names it.

Done:

  • [ ] A new test signs up through the page and the API with: .., a/b, <b>, a name with a NUL, a 200-character name, and a reserved word such as settings or api. Each is refused with invalid_username.
  • [ ] No user row exists after each refusal.
  • [ ] A plain alice-2 succeeds.

Files: test/username-refusals.test.ts

If the test finds the behaviour wrong, fix the module it names in the same pull and say so. If the check fails in a test this pull does not touch, name it in the pull rather than widening the change.

Before pushing: bun x tsc --noEmit and the new test.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs