Skip to content

[Due for payment 2025-04-08] [$250] [Offline] List - On disabling all list values, expense page shows dropdown selected when turn online. #56949

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: V9.0.99-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
Issue reported by: Applause Internal Team
Device used: Redmi note 10s android 13
App Component: Workspace Settings

Action Performed:

  1. Launch app
  2. Go to workspace settings - more features - enable report fields
  3. Add field and create a list type with 2 list values but on confirmation page go offline and save it
  4. Open list created and disable all list values
  5. Go to workspace chat
  6. Create a expense
  7. Open the expense and go online
  8. Note the list field on told and open it

Expected Result:

On disabling all list values, expense page shows must not shown dropdown selected when turn online.

Actual Result:

On disabling all list values, expense page shows dropdown selected when turn online.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6745788_1739803118819.Screenrecorder-2025-02-17-19-53-24-932_compress_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021894547162954323421
  • Upwork Job ID: 1894547162954323421
  • Last Price Increase: 2025-03-05
  • Automatic offers:
    • daledah | Contributor | 106400942
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @isabelastisser / @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 17, 2025
  2. melvin-bot commented on Feb 17, 2025

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (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. daledah commented on Feb 18, 2025

    @daledah
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-02-19 04:00:53 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    • On disabling all list values, expense page shows dropdown selected when turn online.

    What is the root cause of that problem?

    • When creating a new field, we set value to dropdown optimistically if the field type is dropdown:

    value: type === CONST.REPORT_FIELD_TYPES.LIST ? CONST.REPORT_FIELD_TYPES.LIST : null,

    • Then when disabling any option in dropdown report field, we clone the previous field list data which contains value: 'dropdown' key - value and send it to BE:

    const updatedReportField = cloneDeep(reportField);

    lead to in BE side, we stored the report field which has value: 'dropdown'.

    • After step 7, we merged the field list in report and policy:

    const mergedFieldIds = Array.from(new Set([...policyReportFields.map(({fieldID}) => fieldID), ...reportFields.map(({fieldID}) => fieldID)]));

    so finally, the dropdown field has dropdown as the value. That value is displayed as mentioned in the bug.

    What changes do you think we should make in order to solve the problem?

    • We should remove this line:

    value: type === CONST.REPORT_FIELD_TYPES.LIST ? CONST.REPORT_FIELD_TYPES.LIST : null,

    or we can remove the value key when cloning the report field:

    const updatedReportField = cloneDeep(reportField);

        const updatedReportField = cloneDeep({...reportField, value: null});

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    • None

    What alternative solutions did you explore? (Optional)

    Besides the main solution, there is a few additional improvements:

    • When it is a dropdown field and all the options are disabled, we should disable the field row:

    disabled={isFieldDisabled}

    disabled={isFieldDisabled || hasEnableOption}
    const hasEnableOption = reportField.type !== 'dropdown' || reportField.disabledOptions.some((o) => !o);
    • We can also hide right icon and set interactive to false if hasEnableOption is false:

    • We can hide the field row if there is no available option and the fieldValue is empty:
                                    if (!hasEnableOption && !fieldValue) {
                                        return null;
                                    }
  4. changed the title [-]List - On disabling all list values, expense page shows dropdown selected when turn online.[/-] [+][Offline] List - On disabling all list values, expense page shows dropdown selected when turn online.[/+] on Feb 19, 2025
  5. mallenexpensify commented on Feb 19, 2025

    @mallenexpensify
    Contributor

    @daledah , I'm assuming you're able to reproduce, is that correct?
    I'll get to soon (likely next week), not the highest value issue.

  6. MelvinBot commented on Feb 19, 2025

    @MelvinBot
    Contributor

    This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

  7. parasharrajat commented on Feb 19, 2025

    @parasharrajat
    Member

    I can reproduce this with the steps mentioned in the OP.

    19.02.2025_13.19.12_REC.mp4
  8. melvin-bot commented on Feb 24, 2025

    @melvin-bot

    @mallenexpensify Huh... This is 4 days overdue. Who can take care of this?

  9. parasharrajat commented on Feb 24, 2025

    @parasharrajat
    Member

    @mallenexpensify Can you please assign me as C+ as I was able to reproduce this #56949 (comment)? Then I can look further reviewing the proposals to solve this issue.

  10. 58 remaining items

  11. strepanier03 commented on Apr 4, 2025

    @strepanier03
    Contributor

    @isabelastisser - I am going OoO April 5 and returning April 14. This will be due for payment while I'm away.

    The payment summary is above and on hold until the payment date and checklist is complete.

    Thanks so much for finishing it up!

  12. parasharrajat commented on Apr 4, 2025

    @parasharrajat
    Member

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 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: https://github.com/Expensify/App/pull/44275/files#r2029456945

    • [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: Not needed

    • [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.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    • Have a workspace.

    Test:

    1. Enable report fields.
    2. Add field and create a list type with 2 list values but on confirmation page go offline and save it
    3. Open list created and disable all list values
    4. Go to workspace chat
    5. Create a expense
    6. Open the expense and go online
    7. Verify that: the created field is not shown.

    Do we agree 👍 or 👎

  13. isabelastisser commented on Apr 7, 2025

    @isabelastisser
    Contributor

    Not overdue, payments are due tomorrow.

  14. isabelastisser commented on Apr 8, 2025

    @isabelastisser
    Contributor

    Payment summary

    $250 - @parasharrajat via NewDot Manual Requests PENDING

    $250 - @daledah via Upwork automatic offer (Contributor) - Paid in Upworl.

  15. isabelastisser commented on Apr 8, 2025

    @isabelastisser
    Contributor

    all set!

  16. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Apr 8, 2025
  17. parasharrajat commented on May 23, 2025

    @parasharrajat
    Member

    Payment requested as per #56949 (comment)

  18. JmillsExpensify commented on May 29, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @parasharrajat

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions