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
[$250] Report fields - Incorrect list value editor opens after renaming the list value #49546
BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
Version Number: 9.0.39-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers):applausetester+kh010901@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Go to staging.new.expensify.com
Go to workspace settings > Report fields.
Click Add field.
Click Type and select List.
Click List values > Add value.
Add the following values - B, C and D.
Click on list value C.
Click Name field.
Change the name to A and save it.
Expected Result:
List value A (previously C) will open after renaming list value C to A.
Actual Result:
List value B opens after renaming list value C to A.
@isabelastisser FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Please re-state the problem that we are trying to solve in this issue.
Incorrect list value editor opens after renaming the list value
What is the root cause of that problem?
We currently navigate to the report field value page using the index value. However, when we update the report field value, the order of the report field list changes, which also alters the index of the current value.
What changes do you think we should make in order to solve the problem?
We should indicate the report value page (setting page, edit name page,....) by its name rather than its index value. Here’s what we need to do:
Update the routes
Modify the navigate function to accept the name value instead of the index value
By using the name in the route, we can easily identify the corresponding index and utilize that index value
What alternative solutions did you explore? (Optional)
Please re-state the problem that we are trying to solve in this issue.
List value B opens after renaming list value C to A.
What is the root cause of that problem?
We have an error with method Onyx.mergehere, it will merge in alphabetical order
Onyx when merging list like ['c', 'a', 'b'] it saves as ['a', 'b', 'c']
What changes do you think we should make in order to solve the problem?
We should display based on field name rather than index value by
Change 2 routes here and here to use fieldName instead of valueIndex
We need to update code in some components ReportFieldsAddListValuePage, ReportFieldsEditValuePage, ReportFieldsValueSettingsPage to use fieldName params
We alse need to update navigate here when we edit value of fieldName
What alternative solutions did you explore? (Optional)
Simply, we can recalculate the valueIndex in here base on LIST_VALUES and currentFieldName to navigate to correct route when we edit done
changed the title [-]Report fields - Incorrect list value editor opens after renaming the list value[/-][+][$250] Report fields - Incorrect list value editor opens after renaming the list value[/+]on Sep 20, 2024
📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖
The PR that introduced the bug has been identified. Link to the PR: N.A. Original implementation
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: N.A.
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
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
1. Open App
2. Go to workspace settings > Report fields.
3. Click Add field.
4. Click Type and select List.
5. Click List values > Add value.
6. Add the following values - B, C and D.
7. Click on list value C.
8. Click Name field.
9. Change the name to A and save it.
10. Verify that list value A (previously C) will open after renaming.
BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
Activity
melvin-bot commentedon Sep 20, 2024
Triggered auto assignment to @isabelastisser (
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.IuliiaHerets commentedon Sep 20, 2024
@isabelastisser FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
cretadn22 commentedon Sep 20, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Incorrect list value editor opens after renaming the list value
What is the root cause of that problem?
We currently navigate to the report field value page using the index value. However, when we update the report field value, the order of the report field list changes, which also alters the index of the current value.
What changes do you think we should make in order to solve the problem?
We should indicate the report value page (setting page, edit name page,....) by its name rather than its index value. Here’s what we need to do:
What alternative solutions did you explore? (Optional)
nkdengineer commentedon Sep 20, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
List value B opens after renaming list value C to A.
What is the root cause of that problem?
We have an error with method
Onyx.mergehere, it will merge in alphabetical orderOnyx when merging list like ['c', 'a', 'b'] it saves as ['a', 'b', 'c']
What changes do you think we should make in order to solve the problem?
We should display based on field name rather than index value by
fieldNameinstead ofvalueIndexReportFieldsAddListValuePage,ReportFieldsEditValuePage,ReportFieldsValueSettingsPageto usefieldNameparamsfieldNameWhat alternative solutions did you explore? (Optional)
Simply, we can recalculate the
valueIndexin here base onLIST_VALUESandcurrentFieldNameto navigate to correct route when we edit done[-]Report fields - Incorrect list value editor opens after renaming the list value[/-][+][$250] Report fields - Incorrect list value editor opens after renaming the list value[/+]melvin-bot commentedon Sep 20, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021837218246278248735
melvin-bot commentedon Sep 20, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (
External)13 remaining items
melvin-bot commentedon Sep 23, 2024
📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖
shubham1206agra commentedon Sep 25, 2024
Sorry, I missed the assignment notification. I will raise the PR toady.
isabelastisser commentedon Oct 8, 2024
Payment summary:
@shubham1206agra $250 for PR, paid in Upwork.
@rushatgabhane $250 for C+ review, payment pending in NewDot.
isabelastisser commentedon Oct 8, 2024
@rushatgabhane, do we need a regression test?
rushatgabhane commentedon Oct 9, 2024
yes i think we should add a regression step here because this bug is easy to happen if someone decides to refactor / simplify the logic
rushatgabhane commentedon Oct 9, 2024
The PR that introduced the bug has been identified. Link to the PR: N.A. Original implementation
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: N.A.
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
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
isabelastisser commentedon Oct 11, 2024
all set!
garrettmknight commentedon Oct 15, 2024
$250 approved for @rushatgabhane