fix: 81349 Mark as paid via bulk - #81403
Conversation
|
@hungvu193 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MrMuzyk I don't think it works for me. Could you double check? Screen.Recording.2026-02-04.at.23.00.00.mov |
|
@MelvinBot can you please review this PR and look at the comments in the discussion |
🔍 PR Review@srikarparsi Thanks for asking me to review! I've analyzed the PR changes and the discussion comments. Summary of ChangesThis PR refactors
This separation fixes the original issue where "Mark as Paid" was incorrectly opening the bank account flow. Review of @hungvu193's Feedback@hungvu193 identified a valid edge case in their comment:
This is a legitimate concern. Looking at the code: const shouldSelectPaymentMethod = isPaymentMethod || !isEmpty(latestBankItems);The
But then:
Recommended FixThe One approach is to modify the condition in // Only trigger KYC flow if:
// 1. User selected a policy-based payment option (Pay via workspace), OR
// 2. User selected a payment method that requires verification AND the payment type isn't ELSEWHERE
const shouldTriggerKYC = !!policyFromPaymentMethod ||
(shouldSelectPaymentMethod && paymentType !== CONST.IOU.PAYMENT_TYPE.ELSEWHERE);
if (shouldTriggerKYC) {
triggerKYCFlow({...});
// ...
}Alternatively, the filtering could be done in Summary
@MrMuzyk Could you verify the scenario described by @hungvu193 (in-progress bank account) and consider the fix above? The current logic may still incorrectly trigger the KYC flow for "Mark as Paid" when there are incomplete bank verification items. |
|
@MrMuzyk Can you merge main? I guess we still need to correct the logic for |
|
I've rebased with main but at this point these changes are purely cosmetic - they only increase readability of the code |
Yeah, it's worth fixing cause the current logic about Line 229 in 088ed06 As I mentioned, Anw, changes LGTM, I'll do more testing. |
|
Thanks, if you find any more edge cases let me know :D |
|
|
||
| if ((!!selectedPolicy || shouldSelectPaymentMethod) && (isPayingWithMethod || isPayingViaWorkspace)) { | ||
| selectPaymentMethod(event, paymentType, triggerKYCFlow, selectedOption as PaymentMethod, selectedPolicy); | ||
| if ((!!policyFromContext || !!policyFromPaymentMethod || shouldSelectPaymentMethod) && (isPayingWithMethod || !!policyFromPaymentMethod)) { |
There was a problem hiding this comment.
Do we need to add policyFromContext here? 🤔
There was a problem hiding this comment.
I guess we don't need it here. From the old condition, we only need to compare the selectedPolicy or payment method, I don't think policyFromContext is a valid payment method.
There was a problem hiding this comment.
Yup, nice catch, removed it. It was just extra noise and logic remains the same
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-02-06.at.16.35.14.movAndroid: mWeb ChromeScreen.Recording.2026-02-06.at.16.35.14.moviOS: HybridAppScreen.Recording.2026-02-06.at.16.30.17.moviOS: mWeb SafariScreen.Recording.2026-02-06.at.16.26.58.movMacOS: Chrome / SafariScreen.Recording.2026-02-06.at.16.23.17.mov |
|
🚧 @srikarparsi has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 9.3.16-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.16-9 🚀
|

Explanation of Change
Updated the logic inside getActivePaymentType. It will now return two policies with different purpose.
Fixed Issues
$ #81349
PROPOSAL:
Tests
Same as QA steps
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
81349.mp4