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-07-01] [$250] Per diem - App restarts per diem expense creation flow after clicking Save on subrate page #63111
Version Number: 9.1.54-2 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Exp Email or phone of affected tester (no customers):sniodjdsoisjdo@gmail.com Issue reported by: Applause Internal Team Device used: Mac 15.4 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Workspace has per diem rates.
Go to staging.new.expensify.com
Go to workspace chat.
Click + > Create report.
Click Add expense button on the expense preview.
Click Create new expense.
Switch to Per diem.
Select a destination.
Select time and date > Save.
Select subrate and enter quantity.
Click Save on subrate page.
Expected Result:
App will proceed to confirmation page.
Actual Result:
App restarts per diem expense creation flow after clicking Save on subrate page.
Please re-state the problem that we are trying to solve in this issue.
App restarts per diem expense creation flow after clicking Save on subrate page.
What is the root cause of that problem?
The transaction is initialized with reportID pointing to the newly created report (not the workspace report). But the reportID from URL points to the workspace report, because we initialized the flow from the workspace report.
In this line, after selecting the country, we set the reportID in URL to the workspace report:
That logic is to make sure after we confirm the expense creation, we don't automatically open the expense report, but stay in the workspace report.
Because the transaction.reportID does not match the reportID from URL, we call startMoneyRequest and go back to the first step in the flow (the country step):
so the reportID in URL always points to the report that the expense to be create would belong to.
Instead, to make sure this logic still works:
That logic is to make sure after we confirm the expense creation, we don't automatically open the expense report, but stay in the workspace report.
We need to implement backToReport URL param for all the per diem steps, and specify it as the current workspace report so after completing the expense creation, we stay in the workspace report. Just like what we did with other types of expense in this PR #61760:
changed the title [-]Per diem - App restarts per diem expense creation flow after clicking Save on subrate page[/-][+][$250] Per diem - App restarts per diem expense creation flow after clicking Save on subrate page[/+]on Jun 2, 2025
changed the title [-][$250] Per diem - App restarts per diem expense creation flow after clicking Save on subrate page[/-][+][Due for payment 2025-07-01] [$250] Per diem - App restarts per diem expense creation flow after clicking Save on subrate page[/+]on Jun 24, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.70-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@brunovjk@VictoriaExpensify@brunovjk 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]
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: No PR directly introduced this bug.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
No workspace with per diem enabled
Tests
Create a workspace Enable Per diem Import per diem rates
Go to the workspace chat + Create report
Click "Add expense" on the report preview Create new expense
Select Per diem Select any destination country Proceed to confirmation step Create expense
Verify the expense is created and linked to the selected report from step 3
Click FAB Create expense Per diem
Proceed to create a per diem expense
Verify the expense is created and linked to the workspace chat with per diem enabled
Create another workspace with per diem enabled and rates imported
Click FAB Create expense
Select any destination workspace
Proceed to create a per diem expense
Verify the expense is created and linked to the selected workspace chat from step 3
Activity
melvin-bot commentedon May 30, 2025
Triggered auto assignment to @VictoriaExpensify (
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.mkzie2 commentedon May 30, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
App restarts per diem expense creation flow after clicking Save on subrate page.
What is the root cause of that problem?
The transaction is initialized with
reportIDpointing to the newly created report (not the workspace report). But thereportIDfrom URL points to the workspace report, because we initialized the flow from the workspace report.In this line, after selecting the country, we set the
reportIDin URL to the workspace report:App/src/pages/iou/request/step/IOURequestStepDestination.tsx
Lines 95 to 96 in f09bb6d
That logic is to make sure after we confirm the expense creation, we don't automatically open the expense report, but stay in the workspace report.
Because the
transaction.reportIDdoes not match thereportIDfrom URL, we callstartMoneyRequestand go back to the first step in the flow (the country step):App/src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Lines 252 to 261 in fa2cb85
What changes do you think we should make in order to solve the problem?
We should remove this logic:
App/src/pages/iou/request/step/IOURequestStepDestination.tsx
Lines 95 to 96 in f09bb6d
so the
reportIDin URL always points to the report that the expense to be create would belong to.Instead, to make sure this logic still works:
We need to implement
backToReportURL param for all the per diem steps, and specify it as the current workspace report so after completing the expense creation, we stay in the workspace report. Just like what we did with other types of expense in this PR #61760:App/src/ROUTES.ts
Lines 911 to 915 in f09bb6d
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)
Add another exception in this logic so that we won't trigger
startMoneyRequestifrequestTypeis per diem:App/src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Lines 252 to 258 in fa2cb85
VictoriaExpensify commentedon Jun 2, 2025
Yeah we should fix this
[-]Per diem - App restarts per diem expense creation flow after clicking Save on subrate page[/-][+][$250] Per diem - App restarts per diem expense creation flow after clicking Save on subrate page[/+]melvin-bot commentedon Jun 2, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021929345987036305615
melvin-bot commentedon Jun 2, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (
External)brunovjk commentedon Jun 3, 2025
I think we can go with @mkzie2's proposal. Thanks.
🎀👀🎀 C+ reviewed
21 remaining items
[-][$250] Per diem - App restarts per diem expense creation flow after clicking Save on subrate page[/-][+][Due for payment 2025-07-01] [$250] Per diem - App restarts per diem expense creation flow after clicking Save on subrate page[/+]melvin-bot commentedon Jun 24, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 24, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.70-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-07-01. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 24, 2025
@brunovjk @VictoriaExpensify @brunovjk 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]
brunovjk commentedon Jul 1, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: No PR directly introduced this bug.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
No workspace with per diem enabled
Tests
Do we agree 👍 or 👎
VictoriaExpensify commentedon Jul 2, 2025
Raised an issue to add to testrail - https://github.com/Expensify/Expensify/issues/520786
VictoriaExpensify commentedon Jul 2, 2025
Payment Summary:
C: @mkzie2 paid $250 via Upwork
C+: @brunovjk paid $250 via Upwork
Thanks for the hard work!