Repository navigation
feat: prevent usernames colliding with known routes - #199
Open
robsimmons wants to merge 1 commit into
Open
robsimmons wants to merge 1 commit into
robsimmons wants to merge 1 commit into
Conversation
robsimmons
commented
Oct 28, 2026
|
|
||
| # testing | ||
| /coverage | ||
| coverage/ |
Collaborator
Author
There was a problem hiding this comment.
needed to prevent /shared/coverage from being .gitnotignored as well
robsimmons
force-pushed
the
rename-usernames-at-creation
branch
from
October 28, 2026 23:21
1d6c3f9 to
0eafc3a
Compare
robsimmons
force-pushed
the
rename-usernames-at-creation
branch
3 times, most recently
from
October 29, 2026 21:07
3952bf3 to
b45f4e4
Compare
robsimmons
force-pushed
the
rename-usernames-at-creation
branch
2 times, most recently
from
October 30, 2026 12:23
5633d29 to
18a6193
Compare
robsimmons
force-pushed
the
rename-usernames-at-creation
branch
from
October 30, 2026 12:24
18a6193 to
25ed6f4
Compare
robsimmons
force-pushed
the
rename-usernames-at-creation
branch
from
October 30, 2026 12:31
25ed6f4 to
7f75b20
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR does two things:
isAvailableUsername, which allows us to reject already-existing or disallowed usernames. (This doesn't handle race conditions so we're still relying somewhat on the database-level constraint to avoid collision with existing usernames.)findSuitableAlphaNumNamethat tries to find an acceptable name given a function that rejects unacceptable names. When there's a collision, removes any existing numeric postfix and tries to add postfixes starting with 1.Closes #132.