You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-06-05] [Due for payment 2025-05-20] [$250] Per diem - Confirmation page shows per diem confirm page when it is a manual expense #59499
Version Number: 9.1.22-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers):applausetester+3m03i9@applause.expensifail.com Issue reported by: Applause Internal Team Device used: Mac 15.3 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Log in with Expensifail accounts.
Workspace A has Per diem rates.
Workspace B does not have Per diem rates.
Go to staging.new.expensify.com
Go to workspace chat A.
Click + > Submit expense > Per diem.
Select country, time and subrate and submit per diem expense on the confirmation page.
Go to workspace chat B.
Click + > Submit expense > Manual.
Enter amount > Next.
Expected Result:
The confirmation page will be manual expense confirmation page.
Actual Result:
The confirmation page shows per diem confirmation page when it is a manual expense.
We also have to wait for the transactionRequestType update to finish before calling the initMoneyRequest function here to make sure we will use the new value of transactionRequestType
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Per diem - Confirmation page shows per diem confirm page when it is a manual expense[/-][+][$250] Per diem - Confirmation page shows per diem confirm page when it is a manual expense[/+]on Apr 2, 2025
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
🚨 Edited by proposal-police: This proposal was edited at 2025-04-16 16:04:45 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
The confirmation page shows per diem confirmation page when it is a manual expense. This issue occurred for the workspaces where per-diem feature is disabled.
What is the root cause of that problem?
We are saving the previous iouRequestType inside the transaction. And whenever create expense sidebar open it fetches the iouRequestType from transaction. Due to this transactionRequestType is per-diem even though currently selected workspace is not enabled.
But after resetIOUTypeIfChanged useFocusEffect is runs which reset the iouRequestType to perdiem again because of transactionRequestType has older value. So there is inconsistent between selected tab and Step confirmation sidebar.
What changes do you think we should make in order to solve the problem?
To fix this issue we can add new useFocusEffecthere which will run whenever transactionRequestType is changed and call resetIOUTypeIfChanged() like below.
Not only below logic is simple but by adding below logic we can make sure iouRequestType is always up to date and sync with the selected tab.
This will not only solve the current issue but will solve issues we may face in future as well if we add any new tab which will be visible based on some settings.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-][Due for payment 2025-05-20] [$250] Per diem - Confirmation page shows per diem confirm page when it is a manual expense[/-][+][Due for payment 2025-06-05] [Due for payment 2025-05-20] [$250] Per diem - Confirmation page shows per diem confirm page when it is a manual expense[/+]on May 29, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.53-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@getusha@dylanexpensify@getusha The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon Apr 1, 2025
Triggered auto assignment to @dylanexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.daledah commentedon Apr 1, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-04-01 23:37:26 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
The confirmation page shows per diem confirmation page when it is a manual expense.
What is the root cause of that problem?
Currently we are still saving the previous
iouRequestTypeinto the transaction,It leads to
transactionRequestTypehere beingper-diemeven though this workspace is not enabledApp/src/pages/iou/request/IOURequestStartPage.tsx
Lines 65 to 68 in 9e6f6e2
So
isPerDiemRequestinIOURequestStepConfirmationwill betrueand it'll show per diem confirm pageApp/src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Lines 113 to 115 in 9e6f6e2
What changes do you think we should make in order to solve the problem?
per-diembefore then we need to check if we are showingper-diemoptiontransactionRequestTypeupdate to finish before calling theinitMoneyRequestfunction here to make sure we will use the new value oftransactionRequestTypeApp/src/pages/iou/request/IOURequestStartPage.tsx
Lines 72 to 79 in 9e6f6e2
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Per diem - Confirmation page shows per diem confirm page when it is a manual expense[/-][+][$250] Per diem - Confirmation page shows per diem confirm page when it is a manual expense[/+]melvin-bot commentedon Apr 2, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021907347910355058805
melvin-bot commentedon Apr 2, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (
External)nkdengineer commentedon Apr 2, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The confirmation page shows per diem confirmation page when it is a manual expense.
What is the root cause of that problem?
When we start money request flow in a chat, we pass
requestTypeasundefinedApp/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx
Line 152 in c3451e1
App/src/libs/actions/IOU.ts
Lines 868 to 869 in c3451e1
In this page, the
selectedTabis changed because now the per diem is hidden,resetIOUTypeIfChangedis triggered first.App/src/pages/iou/request/IOURequestStartPage.tsx
Lines 85 to 90 in c3451e1
Then the
useFocusEffecthere is triggered, but at this time,selectedTabis stillperdiem. It's pending update hereApp/src/pages/iou/request/IOURequestStartPage.tsx
Lines 72 to 80 in c3451e1
What changes do you think we should make in order to solve the problem?
We can update the
selectTabtomanualhere if the last selected tab isper-diemand the current policy doesn't enableper-diemApp/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx
Line 152 in c3451e1
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
ishakakkad commentedon Apr 5, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-04-16 16:04:45 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
The confirmation page shows per diem confirmation page when it is a manual expense. This issue occurred for the workspaces where per-diem feature is disabled.
What is the root cause of that problem?
iouRequestTypeinside the transaction. And whenever create expense sidebar open it fetches theiouRequestTypefrom transaction. Due to this transactionRequestType is per-diem even though currently selected workspace is not enabled.App/src/pages/iou/request/IOURequestStartPage.tsx
Lines 65 to 68 in 9e6f6e2
But here we reset the tab to manual due to below logic when page loads.
App/src/pages/iou/request/IOURequestStartPage.tsx
Lines 85 to 90 in c3451e1
But after
resetIOUTypeIfChangeduseFocusEffect is runs which reset theiouRequestTypetoperdiemagain because oftransactionRequestTypehas older value. So there is inconsistent betweenselected tabandStep confirmationsidebar.App/src/pages/iou/request/IOURequestStartPage.tsx
Lines 72 to 80 in c3451e1
iouRequestTypefrom transaction which isperdiemso we can see per diem confirm page.App/src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Lines 113 to 115 in 9e6f6e2
What changes do you think we should make in order to solve the problem?
To fix this issue we can add new
useFocusEffecthere which will run whenever transactionRequestType is changed and call resetIOUTypeIfChanged() like below.Not only below logic is simple but by adding below logic we can make sure
iouRequestTypeis always up to date and sync with the selected tab.This will not only solve the current issue but will solve issues we may face in future as well if we add any new tab which will be visible based on some settings.
Or modify existing hook here with following code
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
melvin-bot commentedon Apr 7, 2025
@getusha Huh... This is 4 days overdue. Who can take care of this?
61 remaining items
dylanexpensify commentedon May 28, 2025
tackling today!
dylanexpensify commentedon May 29, 2025
Payment summary:
Contributor: @ishakakkad $250 via Upwork
Contributor+: @getusha $250 via NewDot
Please apply/request!
dylanexpensify commentedon May 29, 2025
@getusha please complete checklist
[-][Due for payment 2025-05-20] [$250] Per diem - Confirmation page shows per diem confirm page when it is a manual expense[/-][+][Due for payment 2025-06-05] [Due for payment 2025-05-20] [$250] Per diem - Confirmation page shows per diem confirm page when it is a manual expense[/+]melvin-bot commentedon May 29, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.53-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-06-05. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon May 29, 2025
@getusha @dylanexpensify @getusha The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
dylanexpensify commentedon Jun 3, 2025
Payment summary:
Contributor: @ishakakkad $250 via Upwork
Contributor+: @getusha $250 via NewDot
Please apply/request!
garrettmknight commentedon Jul 17, 2025
$250 approved for @getusha