Repository navigation
fix(username): accept handles up to the contract's 30 characters - #1888
Merged
Merged
Conversation
Handle shape now delegates to the generated common.v1.Username validator
instead of a hand-copied {2,15} regex, so server-assigned handles such as
ted_livingston_2 are readable, deeplinkable and mentionable. The claim
screen keeps its 15-character cap as MaxClaimableUsernameLength.
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.
New accounts are being assigned handles past 15 characters (e.g.
ted_livingston_2), butHandle.ktstill matched^[a-z0-9_]{2,15}$. The contract has allowed{2,30}since the flipcash2 0.22.0 sync. Such handles failed the shape check, so they couldn't be opened from aflipcash.com/<handle>link or mentioned, and the tipping lookup field cut typed input off at 15.Changes:
isUsernameShaped()now calls the generatedCommon.Username.validate()fromflipcash2-client-protocolinstead of a hand-copied regex, so the contract is the single source for what counts as a handle.@[A-Za-z0-9_]+candidate and confirms it withisUsernameShaped().MaxUsernameLengthis 30, the contract bound. A newMaxClaimableUsernameLength = 15keeps the claim screen and its copy at the product cap.FindByUsernameViewModelbounds input with the contract length, so a 16–30 character handle can be looked up.Fixtures in
AppRouterTestandAbbreviatedLinkTestthat used a 16-character segment as "not a handle" now use 31 characters or a dashed UUID. Real ids are dashed UUIDs, so link classification doesn't change for them.iOS counterpart: same branch name in code-ios-app.