Skip to content

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

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

bmc08gt merged 1 commit into
mainfrom
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 Username still matched ^[a-z0-9_]{2,15}$. The contract has allowed {2,30} since the flipcash2 0.22.0 sync. For those users:

  • the welcome chat's share-profile widget failed to parse and drew as "This Message Needs a Newer Version of Flipcash", which no update could fix
  • the handle couldn't be looked up, mentioned, or opened from a flipcash.com/<handle> link

Changes:

  • Username and MentionDetector accept 2–30 characters.
  • Claiming stays capped at 15. UsernameValidator now enforces that cap itself rather than relying on Username to reject longer input, and takes an optional maximum.
  • UsernameLookupScreen validates against Username.maximumLength, so a handle past the claim cap can still be found.

Swift has no generated validators (generate-swift.sh skips validate.proto), so the pattern is still a hand-kept mirror of the contract. Tests pin both ends (16 and 30 accepted, 31 rejected) for Username, mentions, deep links and the share-profile widget.

Android counterpart: same branch name in code-android-app.

common.v1.Username allows ^[a-z0-9_]{2,30}$ since the flipcash2 0.22.0
contract, but Username still matched {2,15}. The server now assigns
handles like ted_livingston_2 (16 chars) to new accounts, so the welcome
chat's share-profile widget failed to parse and drew as "This Message
Needs a Newer Version of Flipcash", and the handle could not be looked
up, mentioned, or opened from a flipcash.com link.

Username and the mention pattern now take 2-30. Claiming stays capped
at 15: UsernameValidator enforces the cap itself instead of leaning on
Username, and the lookup screen validates against Username.maximumLength
so assigned handles past the cap can still be found.
@bmc08gt bmc08gt self-assigned this Oct 30, 2026
@bmc08gt
bmc08gt merged commit 4ba2fe3 into main Oct 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant