Skip to content

fix(validation): stop sending empty user ids and short mints, and check inputs before the RPC - #1922

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/validation-client-inputs
Oct 31, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
fix/validation-client-inputs

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Client-side validation failures from Bugsnag group 6aba977 (ValidationException, 459 production events, 29 users) come from six different causes. The triage brief (.claude/plans/triage-6aba9772991833fd0964d3c3.md on docs/bugsnag-validation-triage) splits them by field. This PR covers the two client bugs it left open and the three user-input fields with no UI guard. username is fixed by the 0.24.0 pin already on code/cash, and message_ids by #1676.

Client bugs

  • user_id: UserManager.clear() set accountId = NoId, an empty list, so the ?: return guards in AccountController and ProfileController passed it through. clear() now sets null, and the accountId getter reads an empty id as missing. Brief marks this cause as likely, from two Internal events.
  • Short mint (addresses[0], address): I could not name the caller. The stack resumes from the main Handler. Two changes close the holes I could confirm: AppRouter.handleTokenLink took the raw path segment as a mint, so /token/<short> or a non-base58 segment now returns no deeplink, and TokenCoordinator.getTokenMetadata / getHistoricalMarketCapData now fail fast on a mint that is not 32 bytes (Mint.isValid) and trace the bad value and the method. If the persisted-selection or Room paths are the source, the next event will say so.

Input checks (limits from the pinned contracts: flipcash2-client-protocol 0.24.0, ocp-client-protocol 0.9.0)

  • Create Group group.title: min_len 1, max_len 64 on PublicGroupChatParameters and PrivateGroupChatParameters. CreateGroupViewModel.hasTitle now uses ChatTitle, the rule Edit Group already uses (trimmed, code points). ChatTitle moved from :features:messenger to :shared:chat so :features:tipping can reach it.
  • display_name outside onboarding: SetDisplayNameRequest, min_len 1, max_len 64. My Account and Tip Card setup now use isWithinDisplayNameLimit (code points, measured as typed because those sources send the text untrimmed). The Done-key guard in ConfirmNameChange now applies to every source, not only onboarding.
  • Currency name: CheckAvailabilityRequest and LaunchRequest, max_len 32, pattern ^[!-~]([ -~]*[!-~])?$. New CurrencyName rule gates hasName (Next button) and the CheckName event, which the Done key reaches without the button gate.

All three checks follow the existing pattern of disabling the Next/Create button from state, as onboarding display name does. No strings, components or styles changed.

Tests: MintTest, UserManagerTest, AppRouterTest, ChatTitleTest, CreateGroupStateTest, NameEntryStateTest, CurrencyNameTest. Each limit has an at-limit and one-over case.

@bmc08gt bmc08gt self-assigned this Oct 31, 2026
@github-actions github-actions Bot added type: fix Bug fix area: crypto Solana, keys, encryption, signing area: network gRPC, connectivity, API, exchange rates area: tokens Token accounts, balances, token info area: deeplinks Deep link handling, URL routing, and link parsing and removed type: fix Bug fix labels Oct 31, 2026
@bmc08gt
bmc08gt merged commit e973212 into code/cash Oct 31, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: crypto Solana, keys, encryption, signing area: deeplinks Deep link handling, URL routing, and link parsing area: network gRPC, connectivity, API, exchange rates area: tokens Token accounts, balances, token info

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant