Fix magic code navigates back on payment (useSelectionMode & MoneyReportHeaderSelectionDropdown)#96986
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 995005a4bb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const kycWallRef = useContext(KYCWallContext); | ||
|
|
||
| // Store the pending payment and resume it after the user validates, instead of dropping it on the way to the magic-code screen. | ||
| const {isUserValidated, verifyAccountAndResume} = useVerifyAccountAndResume((retry) => retry?.()); |
There was a problem hiding this comment.
Re-check locks before resuming selection payments
When an unvalidated user starts a selection-mode payment, this resume handler invokes the stored retry directly after magic-code validation. That retry is the press-time closure, so if NVP_PRIVATE_LOCK_ACCOUNT_DETAILS loads late or the account becomes locked while the verify-account screen is open, the resumed flow bypasses shouldBlockAction and confirmPayment does not re-check isAccountLocked, allowing the payment/KYC flow to continue instead of showing the locked-account modal. Please re-run the current non-validation blockers before executing the stored retry.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Is getting account locked while typing the verification code a realistic scenario ? I'd say no
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
Explanation of Change
Reuse the
useVerifyAccountAndResumehook across theMoneyReportHeaderpay flows so an unvalidated user's payment action is stored and resumed after they enter their magic code.Fixed Issues
$ #72980
PROPOSAL:
Tests
Pre requisite:
Test steps:
2. Create a workspace as admin (via green "+" button)
3. Navigate to the Inbox tab and create an expense
4. Submit 2 expenses under one report
5. Click on the Report
6. Select expenses
7. Click on the 2 selected > Pay [Amount] > Pay with business account
8. Verify that the magic code verification modal slides out.
9. Input the magic code
10. Verify that Add bank account RHP shows after successful verification.
Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-07-23.at.15.06.41.mov
Android: mWeb Chrome
Screen.Recording.2026-07-23.at.15.07.46.mov
iOS: Native
Screen.Recording.2026-07-23.at.15.01.27.mov
iOS: mWeb Safari
Screen.Recording.2026-07-23.at.15.03.08.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-23.at.14.49.33.mov