-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore(runway): cherry-pick fix(card): cp-7.60.0 debounced inputs on onboarding flow #23066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(runway): cherry-pick fix(card): cp-7.60.0 debounced inputs on onboarding flow #23066
Conversation
…nboarding flow (#22747) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> This PR fixes a race condition bug in the onboarding flow where users typing quickly and immediately pressing submit buttons would have their input data lost due to debounce delays. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Fixed a bug where rapidly typing in Card onboarding forms and immediately submitting could send incomplete data to the server ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: Onboarding form submission with rapid typing Scenario: user types email rapidly and submits immediately in Sign Up screen Given user is on the Sign Up screen And all form fields are empty When user rapidly types "test@example.com" in email field And user rapidly types "Password123!" in password field And user rapidly types "Password123!" in confirm password field And user selects a country And user immediately presses Continue button (within 1 second) Then the API should receive "test@example.com" (not partial/stale email) And user should navigate to Confirm Email screen Scenario: user types phone number rapidly and submits immediately in Set Phone Number screen Given user is on the Set Phone Number screen And country code is selected When user rapidly types "1234567890" in phone number field And user immediately presses Continue button (within 1 second) Then the API should receive "1234567890" (not partial phone number) And user should navigate to Confirm Phone Number screen Scenario: US user types SSN rapidly and submits immediately in Personal Details screen Given user is on the Personal Details screen And user has selected US as country And first name, last name, date of birth, and nationality are filled When user rapidly types "123456789" (9 digits) in SSN field And user immediately presses Continue button (within 1 second) Then the API should receive "123456789" (complete SSN, not partial) And user should navigate to Physical Address screen Scenario: user submits invalid data with rapid typing Given user is on the Sign Up screen When user rapidly types "invalid-email" in email field And user rapidly types "weak" in password field And user rapidly types "weak" in confirm password field And user selects a country And user immediately presses Continue button Then validation errors should be shown And API should not be called And user should remain on Sign Up screen ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Use non-debounced field values for validation/submission in onboarding forms and switch consent `policyType` from `US` to `us`. > > - **Onboarding UI (validation/submission)**: > - Sign Up (`SignUp.tsx`): validate/submit using live `email`, `password`, `confirmPassword`; update `isDisabled`; send current values to API; tweak handlers. > - Set Phone Number (`SetPhoneNumber.tsx`): validate `phoneNumber` (4–15 digits) before submit; compute `isDisabled` from current value; pass live number to API/navigation; adjust error handling. > - Personal Details (`PersonalDetails.tsx`): require and validate `SSN` (9 digits) for US before submit; compute `isDisabled` using live `SSN`; send current `ssn` to API. > - **Consent policy casing**: > - Change consent `policyType` from `US` to `us` across code, tests, and types (`useRegisterUserConsent.ts`, `useRegisterUserConsent.test.ts`, `CardSDK.test.ts`, `types.ts`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b039631. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsAll 7 changed files are related to Card onboarding functionality within the
Impact Assessment:
Why SmokeCard tag:
Risk Level: Medium because:
Note: The changes appear to be existing files being modified rather than new files, though without git diff access I cannot determine the exact nature of modifications. Running SmokeCard tests will verify the Card functionality including any UI flows that might be affected by these changes. |
|
|
No release label on PR. Adding release label release-7.60.0 on PR, as PR was cherry-picked in branch 7.60.0. |



Description
This PR fixes a race condition bug in the onboarding flow where users
typing quickly and immediately pressing submit buttons would have their
input data lost due to debounce delays.
Changelog
CHANGELOG entry: Fixed a bug where rapidly typing in Card onboarding
forms and immediately submitting could send incomplete data to the
server
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Use non-debounced form values for onboarding validation/submission and standardize consent
policyTypetous.SignUp,SetPhoneNumber,PersonalDetailsnow validate/submit using current (non-debounced) inputs and updateisDisabledaccordingly.^\d{4,15}$, SSN^\d{9}$(US only); block submit and surface errors when invalid.debounced*in API calls/navigation with live values; minor error rendering tweaks and cleanup.policyTypefromUStousinuseRegisterUserConsentand comparisons.CreateOnboardingConsentRequesttype topolicyType: 'us' | 'global'and adjust tests (useRegisterUserConsent.test.ts,CardSDK.test.ts).Written by Cursor Bugbot for commit 4fb1a77. This will update automatically on new commits. Configure here.
6a0949c