feat(deposit): fixes routing after user is authenticated#17393
Conversation
|
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. |
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
There was a problem hiding this comment.
Bug: KYC Routing Flaws Cause Submission Errors
The KYC routing logic contains flaws in its form submission checks and recursive handling. Conditions like form?.isSubmitted === false or !form?.isSubmitted incorrectly evaluate when a form is not present in the requiredForms array, leading to missed routing (e.g., Basic Info, Additional Verification) or attempts to auto-submit non-existent forms (Purpose of Usage). Additionally, exceeding the recursive depth limit (5) for Purpose of Usage form submission causes routeAfterAuthentication to return early, leaving users stuck without further routing.
app/components/UI/Ramp/Deposit/hooks/useDepositRouting.ts#L402-L424
metamask-mobile/app/components/UI/Ramp/Deposit/hooks/useDepositRouting.ts
Lines 402 to 424 in d241a07
app/components/UI/Ramp/Deposit/hooks/useDepositRouting.ts#L436-L437
metamask-mobile/app/components/UI/Ramp/Deposit/hooks/useDepositRouting.ts
Lines 436 to 437 in d241a07
Bug: Analytics Event Timing Error
The RAMPS_OTP_CONFIRMED success analytics event is incorrectly tracked before routeAfterAuthentication(quote). This leads to inaccurate analytics, as the event is sent even if routing subsequently fails. The event should only be tracked after successful routing.
app/components/UI/Ramp/Deposit/Views/OtpCode/OtpCode.tsx#L176-L188
metamask-mobile/app/components/UI/Ramp/Deposit/Views/OtpCode/OtpCode.tsx
Lines 176 to 188 in d241a07
Was this report helpful? Give feedback by reacting with 👍 or 👎
|
|
Skipping e2e after 3 attemps |



Description
Updates the
useDepositRoutinghook to correctly follow the rules needed for maintaining user state when routing. Pages now callrouteAfterAuthenticationwhen they are routing which will take care of fetching forms for updated kyc status.Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist