Repository navigation
fix(validation): stop sending empty user ids and short mints, and check inputs before the RPC - #1922
Merged
Merged
Conversation
…ck inputs before the RPC
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.
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.mdondocs/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.usernameis fixed by the 0.24.0 pin already oncode/cash, andmessage_idsby #1676.Client bugs
user_id:UserManager.clear()setaccountId = NoId, an empty list, so the?: returnguards inAccountControllerandProfileControllerpassed it through.clear()now sets null, and theaccountIdgetter reads an empty id as missing. Brief marks this cause as likely, from two Internal events.addresses[0],address): I could not name the caller. The stack resumes from the mainHandler. Two changes close the holes I could confirm:AppRouter.handleTokenLinktook the raw path segment as a mint, so/token/<short>or a non-base58 segment now returns no deeplink, andTokenCoordinator.getTokenMetadata/getHistoricalMarketCapDatanow 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)
group.title:min_len 1, max_len 64onPublicGroupChatParametersandPrivateGroupChatParameters.CreateGroupViewModel.hasTitlenow usesChatTitle, the rule Edit Group already uses (trimmed, code points).ChatTitlemoved from:features:messengerto:shared:chatso:features:tippingcan reach it.display_nameoutside onboarding:SetDisplayNameRequest,min_len 1, max_len 64. My Account and Tip Card setup now useisWithinDisplayNameLimit(code points, measured as typed because those sources send the text untrimmed). The Done-key guard inConfirmNameChangenow applies to every source, not only onboarding.name:CheckAvailabilityRequestandLaunchRequest,max_len 32, pattern^[!-~]([ -~]*[!-~])?$. NewCurrencyNamerule gateshasName(Next button) and theCheckNameevent, 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.