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
[HOLD for payment 2023-12-26] [$500] Expense-In "recents",category selected while creating expense is displayed instead of altered. #32230
Version Number: 1.4.5-4 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Note, the category selected while creating expense is displayed in "recents" on top
Refresh the page
Note, the category altered after expense created is displayed in "recents" now
Expected Result:
The category altered after expense created must be displayed in "recents" on top
Actual Result:
The category selected while creating expense is displayed in "recents" on top. The altered category is shown in "recents" only after refreshing the page
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Expense-In "recents",category selected while creating expense is displayed instead of altered.[/-][+][$500] Expense-In "recents",category selected while creating expense is displayed instead of altered.[/+]on Nov 29, 2023
Please re-state the problem that we are trying to solve in this issue.
Expense-In "recents",category selected while creating expense is displayed instead of altered
What is the root cause of that problem?
Currently, we only update policyRecentlyUsedCategories when creating new request. We don't update policyRecentlyUsedCategories when editing a request
What changes do you think we should make in order to solve the problem?
We need to add logic to update policyRecentlyUsedCategories when editing category field
To do that in editDistanceMoneyRequest we should add this logic
let optimisticPolicyRecentlyUsedCategories = [];
if (_.has(transactionChanges, 'category')) {
optimisticPolicyRecentlyUsedCategories = Policy.buildOptimisticPolicyRecentlyUsedCategories(iouReport.policyID, transactionChanges.category);
if (!_.isEmpty(optimisticPolicyRecentlyUsedCategories)) {
optimisticData.push({
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES}${iouReport.policyID}`,
value: optimisticPolicyRecentlyUsedCategories,
});
}
}
Do the same thing to EditMoneyRequest Function
We can create new utils function to avoid duplicated code. This function will handle both updating recently used categories and recently used tags in both editDistanceMoneyRequest and EditMoneyRequest function
What alternative solutions did you explore? (Optional)
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.13-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 2023-12-26. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@hoangzinh] The PR that introduced the bug has been identified. Link to the PR:
[@hoangzinh] 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:
[@hoangzinh] A discussion in #expensify-bugs 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:
[@hoangzinh] Determine if we should create a regression test for this bug.
[@hoangzinh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@anmurali] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
A discussion in #expensify-bugs 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
Determine if we should create a regression test for this bug: Yes
Activity
[-]Expense-In "recents",category selected while creating expense is displayed instead of altered.[/-][+][$500] Expense-In "recents",category selected while creating expense is displayed instead of altered.[/+]melvin-bot commentedon Nov 29, 2023
Triggered auto assignment to @anmurali (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Nov 29, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01f8b6f650f2e88ed5
melvin-bot commentedon Nov 29, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Nov 29, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (
External)DylanDylann commentedon Nov 30, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense-In "recents",category selected while creating expense is displayed instead of altered
What is the root cause of that problem?
Currently, we only update
policyRecentlyUsedCategorieswhen creating new request. We don't updatepolicyRecentlyUsedCategorieswhen editing a requestWhat changes do you think we should make in order to solve the problem?
We need to add logic to update
policyRecentlyUsedCategorieswhen editingcategoryfieldTo do that in
editDistanceMoneyRequestwe should add this logicDo the same thing to
EditMoneyRequestFunctionWe can create new utils function to avoid duplicated code. This function will handle both updating recently used categories and recently used tags in both
editDistanceMoneyRequestandEditMoneyRequestfunctionWhat alternative solutions did you explore? (Optional)
hoangzinh commentedon Dec 1, 2023
@DylanDylann Thanks for your proposal #32230 (comment)
🎀👀🎀 C+ reviewed
melvin-bot commentedon Dec 1, 2023
Triggered auto assignment to @bondydaa, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
19 remaining items
melvin-bot commentedon Dec 19, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.13-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 2023-12-26. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Dec 19, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
melvin-bot commentedon Dec 28, 2023
@bondydaa, @hoangzinh, @anmurali, @DylanDylann Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
hoangzinh commentedon Dec 29, 2023
Regression Test Proposal
Do we agree 👍 or 👎
hoangzinh commentedon Dec 29, 2023
BugZero Checklist:
melvin-bot commentedon Jan 1, 2024
@bondydaa, @hoangzinh, @anmurali, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Jan 1, 2024
@bondydaa, @hoangzinh, @anmurali, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick!
anmurali commentedon Jan 2, 2024
All done.