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-05-20] [$250] Expense - "Category no longer valid" briefly seen when submitting track expense to new WS. #61153
Version Number: 9.1.38-0 Reproducible in staging?: Yes Reproducible in production?: Yes 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):ibellicotest+635@gmail.com Issue reported by: Applause Internal Team Device used: Motorola MotoG60 - Android 12 - Chrome / Windows 10 - Chrome App Component: Money Requests
Action Performed:
Open the staging.new.expensify.com website.
Tap on FAB and select "Create Expense"
Tap on "Manual"
Complete the creation flow and submit the expense to Self DM.
Tap on "Share with my accountant" on system message below expense report.
Tap on "New Workspace"
Add a merchant and a category and submit the expense.
Dismiss RHP.
Open the just created expense report.
Note that a "Category no longer valid" erorr message can be seen briefly on category field.
Expected Result:
No error message should be displayed on category field after submitting a track expense to a new workspace with a valid category.
Actual Result:
"Category no longer valid" error message can be seen briefly on category field, after submitting a track expense to a new workspace and opening the report.
🚨 Edited by proposal-police: This proposal was edited at 2025-04-30 07:57:49 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
"Category no longer valid" error message can be seen briefly on category field, after submitting a track expense to a new workspace and opening the report.
What is the root cause of that problem?
In this case, we're creating the new expense report along with new policy. And we create the policyDraft and policyCategoryDraft to show in IOURequestStepConfirmation
For the policyCategoriesDraft we're getting it from policyCategories_draftPolicyID, but the policy category draft is stored in policyCategoriesDraft_draftPolicyID, that causes policyCategoriesDraft empty so we build the violation optimistically if we can't find the category
After Be returns data, we'll use the real policy and category so the violation disappears
What changes do you think we should make in order to solve the problem?
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can render the IOURequestStepConfirmation with mocked data then make sure after creating track expense, there's no violation for category
What alternative solutions did you explore? (Optional)
None
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 [-]Expense - "Category no longer valid" briefly seen when submitting track expense to new WS.[/-][+][$250] Expense - "Category no longer valid" briefly seen when submitting track expense to new WS.[/+]on Apr 30, 2025
changed the title [-][$250] Expense - "Category no longer valid" briefly seen when submitting track expense to new WS.[/-][+][Due for payment 2025-05-20] [$250] Expense - "Category no longer valid" briefly seen when submitting track expense to new WS.[/+]on May 13, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.44-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@hungvu193@lschurr@hungvu193 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: There are so many overlapping changes. Unfortunately I couldn't find the offending PR. The original code (policy draft) was added almost 2 years ago.
[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: N/A
[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
Test:
Open the staging.new.expensify.com website.
Tap on FAB and select "Create Expense"
Tap on "Manual"
Complete the creation flow and submit the expense to Self DM.
Tap on "Share with my accountant" on system message below expense report.
Tap on "New Workspace"
Add a merchant and a category and submit the expense.
Activity
melvin-bot commentedon Apr 30, 2025
Triggered auto assignment to @lschurr (
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.nkdengineer commentedon Apr 30, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-04-30 07:57:49 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
"Category no longer valid" error message can be seen briefly on category field, after submitting a track expense to a new workspace and opening the report.
What is the root cause of that problem?
In this case, we're creating the new expense report along with new policy. And we create the policyDraft and policyCategoryDraft to show in
IOURequestStepConfirmationApp/src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Lines 87 to 90 in 4453806
For the
policyCategoriesDraftwe're getting it frompolicyCategories_draftPolicyID, but the policy category draft is stored inpolicyCategoriesDraft_draftPolicyID, that causespolicyCategoriesDraftempty so we build the violation optimistically if we can't find the categoryAfter Be returns data, we'll use the real policy and category so the violation disappears
What changes do you think we should make in order to solve the problem?
we should change this line:
App/src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Line 90 in 4453806
to
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can render the IOURequestStepConfirmation with mocked data then make sure after creating track expense, there's no violation for category
What alternative solutions did you explore? (Optional)
None
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.
[-]Expense - "Category no longer valid" briefly seen when submitting track expense to new WS.[/-][+][$250] Expense - "Category no longer valid" briefly seen when submitting track expense to new WS.[/+]melvin-bot commentedon Apr 30, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021917621735274303658
melvin-bot commentedon Apr 30, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 (
External)hungvu193 commentedon May 1, 2025
I'll review in the morning
hungvu193 commentedon May 2, 2025
@nkdengineer 's proposal here has the correct RCA and straightforward solution! LGTM
🎀 👀 🎀 C+ reviewed
melvin-bot commentedon May 2, 2025
Triggered auto assignment to @youssef-lr, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
6 remaining items
[-][$250] Expense - "Category no longer valid" briefly seen when submitting track expense to new WS.[/-][+][Due for payment 2025-05-20] [$250] Expense - "Category no longer valid" briefly seen when submitting track expense to new WS.[/+]melvin-bot commentedon May 13, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon May 13, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.44-8 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-05-20. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon May 13, 2025
@hungvu193 @lschurr @hungvu193 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]
lschurr commentedon May 19, 2025
@hungvu193 could you work on the checklist for this one?
lschurr commentedon May 20, 2025
Payment summary:
hungvu193 commentedon May 21, 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: There are so many overlapping changes. Unfortunately I couldn't find the offending PR. The original code (policy draft) was added almost 2 years ago.
[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: N/A
[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
Test:
Do we agree 👍 or 👎
garrettmknight commentedon Jun 3, 2025
$250 approved for @hungvu193