Skip to content

fix(username): accept handles up to the contract's 30 characters - #1888

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/username-length
Oct 30, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
fix/username-length

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

New accounts are being assigned handles past 15 characters (e.g. ted_livingston_2), but Handle.kt still 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 a flipcash.com/<handle> link or mentioned, and the tipping lookup field cut typed input off at 15.

Changes:

  • isUsernameShaped() now calls the generated Common.Username.validate() from flipcash2-client-protocol instead of a hand-copied regex, so the contract is the single source for what counts as a handle.
  • Mention detection matches a loose @[A-Za-z0-9_]+ candidate and confirms it with isUsernameShaped().
  • MaxUsernameLength is 30, the contract bound. A new MaxClaimableUsernameLength = 15 keeps the claim screen and its copy at the product cap.
  • FindByUsernameViewModel bounds input with the contract length, so a 16–30 character handle can be looked up.

Fixtures in AppRouterTest and AbbreviatedLinkTest that 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.

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.
@bmc08gt bmc08gt self-assigned this Oct 30, 2026
@github-actions github-actions Bot added area: network gRPC, connectivity, API, exchange rates area: deeplinks Deep link handling, URL routing, and link parsing type: fix Bug fix labels Oct 30, 2026
@bmc08gt
bmc08gt merged commit 0643cf0 into code/cash Oct 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: deeplinks Deep link handling, URL routing, and link parsing area: network gRPC, connectivity, API, exchange rates type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant