Repository navigation
[Payment due @huult] Hide Pay and Unapprove while a cancelled payment is processing - #102489
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
Tag me when it's ready! thank you |
|
@huult lets connect to my local VM tomorrow, the BE is yet not deployed, can you DM me when you start your day tomorrow ? |
Sure, I’ll DM you when I start at 14:00 GMT+7 today. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@jayeshmangwani 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] |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-10-20.at.11.03.33.mov |
| const isExpense = isExpenseReport(report); | ||
|
|
||
| if (isPayBlockedByArchivedState(report, policy, isReportArchived)) { | ||
| if (isPayBlockedByArchivedState(report, policy, isReportArchived) || report.isWaitingForCancelledReimbursement) { |
There was a problem hiding this comment.
I think we should create an isPayBlocked helper in ReportUtils, for example:
function isPayBlocked(
report: OnyxInputOrEntry<Report>,
policy: OnyxInputOrEntry<Policy>,
isReportOrChatArchived: boolean,
): boolean {
return isPayBlockedByArchivedState(report, policy, isReportOrChatArchived) || !!report?.isWaitingForCancelledReimbursement;
}This would allow us to reuse it in ReportPreviewActionUtils, ReportPrimaryActionUtils, and ReportWorkflow.
There was a problem hiding this comment.
done for preview and primary 1778c29
left canIOUBePaid, it checks archived state only at the end, so the helper would start blocking IOU pay in archived chats
dylanexpensify
left a comment
There was a problem hiding this comment.
Looks good from a product perspective 👍
|
@cretadn22 Can we use the user_good bank account to test this? |
|
bump @cead22 #102489 (comment) |
|
Try it and see if it works! |
|
@huult let us know what you find in your testing |
|
@allgandalf I haven’t been able to reproduce it yet. Do you have any ideas on how to reproduce it? |
|
@allgandalf Could you update the test steps so I can reproduce the issue? |
@cead22 thanks! Yes, I tested with the paying account: the workspace's USD business ACH account (ending Which reimbursement account does QA use for this, and how can I get access to it on staging? |
|
They have many so I'm not sure, but I can ask. Why do you need that though, out of curiosity? So long as you can test on a dev account and leave good test steps for QA, they should be able to follow your steps with one of their accounts that has the right setup (or, they'd be able to set up a new account from scratch) and test this
Is this something that's coming from the backend? |
|
I will check if i can do something with my local Backend so @huult can test this flow |
@cead22 thanks for the help! I was able to test the client side with mock data (setting |
@allgandalf I was able to test it with mock data. Is this expected? Could you check the QA steps to see if QA can test this case? If not, please update the PR title to [No QA]. Screen.Recording.2026-10-20.at.11.03.33.mov |
|
@puneetlath 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] |
|
🎯 @huult, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
|
🚧 puneetlath 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/puneetlath in version: 9.5.15-1 🚀
|
|
No help site update needed. This change temporarily hides Pay and Unapprove while a cancelled payment is still being processed, which is a rare case. The new next step message explains it in the app, and no existing article says these actions are available after you cancel a payment. |
|
🚀 Deployed to production by https://github.com/grgia in version: 9.5.15-3 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Payment issue created: #104625 |
Explanation of Change
When a payment is cancelled after the money left the payer's account, it takes a few days to come back, and Pay and Unapprove both fail until then. This hides both while
isWaitingForCancelledReimbursementis true and adds thewaitingForCancelledReimbursementnext step message.Keeping this as draft until the backend change that sends the flag and next step is deployed.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/671582
PROPOSAL: N/A
Tests
Offline tests
N/A, the flag and next step come from the server.
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari