Skip to content

[$250] Report fields - Incorrect list value editor opens after renaming the list value #49546

Closed

Description

@IuliiaHerets

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


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:

  1. Go to staging.new.expensify.com
  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.

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.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6609930_1726837303619.20240920_205727.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021837218246278248735
  • Upwork Job ID: 1837218246278248735
  • Last Price Increase: 2024-09-20
  • Automatic offers:
    • shubham1206agra | Contributor | 104094354
Issue OwnerCurrent Issue Owner: @rushatgabhane

Activity

  1. added
    Daily
    Bug
    on Sep 20, 2024
  2. melvin-bot commented on Sep 20, 2024

    @melvin-bot

    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.

  3. IuliiaHerets commented on Sep 20, 2024

    @IuliiaHerets
    Author

    @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

  4. cretadn22 commented on Sep 20, 2024

    @cretadn22
    Contributor

    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:

    • 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)

  5. nkdengineer commented on Sep 20, 2024

    @nkdengineer
    Contributor

    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.merge here, 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

    1. Change 2 routes here and here to use fieldName instead of valueIndex
    2. We need to update code in some components ReportFieldsAddListValuePage, ReportFieldsEditValuePage, ReportFieldsValueSettingsPage to use fieldName params
    3. 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

  6. moved this to Release 2: Summer 2024 (Aug) in #expensify-bugson Sep 20, 2024
  7. added
    External
    Help Wanted
    on Sep 20, 2024
  8. 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
  9. melvin-bot commented on Sep 20, 2024

    @melvin-bot
  10. melvin-bot commented on Sep 20, 2024

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External)

  11. 13 remaining items

  12. melvin-bot commented on Sep 23, 2024

    @melvin-bot

    📣 @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 📖

  13. shubham1206agra commented on Sep 25, 2024

    @shubham1206agra
    Contributor

    Sorry, I missed the assignment notification. I will raise the PR toady.

  14. added
    Reviewing
    Weekly
    and removed
    Daily
    on Sep 26, 2024
  15. isabelastisser commented on Oct 8, 2024

    @isabelastisser
    Contributor

    Payment summary:

    @shubham1206agra $250 for PR, paid in Upwork.
    @rushatgabhane $250 for C+ review, payment pending in NewDot.

  16. isabelastisser commented on Oct 8, 2024

    @isabelastisser
    Contributor

    @rushatgabhane, do we need a regression test?

  17. rushatgabhane commented on Oct 9, 2024

    @rushatgabhane
    Member

    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

  18. rushatgabhane commented on Oct 9, 2024

    @rushatgabhane
    Member
    1. The PR that introduced the bug has been identified. Link to the PR: N.A. Original implementation

    2. 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.

    3. 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.

    4. Determine if we should create a regression test for this bug. Yes

    5. 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.
      
  19. isabelastisser commented on Oct 11, 2024

    @isabelastisser
    Contributor

    all set!

  20. moved this from Release 2: Summer 2024 (Aug) to Done in #expensify-bugson Oct 11, 2024
  21. garrettmknight commented on Oct 15, 2024

    @garrettmknight
    Contributor

    $250 approved for @rushatgabhane

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugExternalReviewingWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions