Skip to content

[$250] Expense preview - Disabled list report field value is displayed on expense preview #59355

Closed

Description

@jponikarchuk

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.1.21-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: #57923
Email or phone of affected tester (no customers): expensify416+da2@gmail.com
Issue reported by: Applause Internal Team
Device used: MacOS Chrome, Desktop
App Component: Money Requests

Action Performed:

  1. Enable report fields
  2. Go to Report fields > Add field > Add name > select list type > Add list values > select initial value
  3. Go offline > Click Save
  4. Go to the workspace chat
  5. Create expense
  6. Return to the workspace Report field
  7. Select the list report field > List values > disable all added values
  8. Return to the workspace chat > open the expense
  9. Apply online mode

Expected Result:

Report field on the expense preview shouldn't be displayed

Actual Result:

Report field on the expense preview shows the report fields initial value

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6784750_1743110346795.Dvnb8264_1_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021906953766885392501
  • Upwork Job ID: 1906953766885392501
  • Last Price Increase: 2025-05-06
Issue OwnerCurrent Issue Owner: @Pujan92

Activity

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

    @melvin-bot

    Triggered auto assignment to @kadiealexander (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. nkdengineer commented on Mar 31, 2025

    @nkdengineer
    Contributor

    Proposal

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

    Report field on the expense preview shows the report fields initial value

    What is the root cause of that problem?

    We only hide the report field if the fieldValue is not empty. In our case reportField.defaultValue is not empty then this returns false.

    const shouldHideSingleReportField = (reportField: PolicyReportField) => {
    const fieldValue = reportField.value ?? reportField.defaultValue;
    const hasEnableOption = reportField.type !== CONST.REPORT_FIELD_TYPES.LIST || reportField.disabledOptions.some((option) => !option);
    return isReportFieldOfTypeTitle(reportField) || (!fieldValue && !hasEnableOption);

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

    I think we can remove !fieldValue check here

    const shouldHideSingleReportField = (reportField: PolicyReportField) => {
    const fieldValue = reportField.value ?? reportField.defaultValue;
    const hasEnableOption = reportField.type !== CONST.REPORT_FIELD_TYPES.LIST || reportField.disabledOptions.some((option) => !option);
    return isReportFieldOfTypeTitle(reportField) || (!fieldValue && !hasEnableOption);

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

    UI bug.

    What alternative solutions did you explore? (Optional)

    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.

  4. github-actions commented on Mar 31, 2025

    @github-actions
    Contributor

    ⚠️ @nkdengineer Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

  5. FitseTLT commented on Mar 31, 2025

    @FitseTLT
    Contributor

    Proposal

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

    Expense preview - Disabled list report field value is displayed on expense preview

    What is the root cause of that problem?

    We won't hide the field if we the list report field has a defaultValue

    const shouldHideSingleReportField = (reportField: PolicyReportField) => {
    const fieldValue = reportField.value ?? reportField.defaultValue;
    const hasEnableOption = reportField.type !== CONST.REPORT_FIELD_TYPES.LIST || reportField.disabledOptions.some((option) => !option);
    return isReportFieldOfTypeTitle(reportField) || (!fieldValue && !hasEnableOption);

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

    We need to only avoid hiding the field only if it has a previously set value (defaultValue shouldn't matter) so we should remove the reportField.defaultValue from here

    const fieldValue = reportField.value ?? reportField.defaultValue;

    This is exactly the logic we use for other list fields like category in other places as here
    const shouldShowCategory = isPolicyExpenseChat && (transactionCategory || hasEnabledOptions(policyCategories ?? {}));

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

    Not needed

    What alternative solutions did you explore? (Optional)

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 1, 2025
  7. changed the title [-]Expense preview - Disabled list report field value is displayed on expense preview[/-] [+][$250] Expense preview - Disabled list report field value is displayed on expense preview[/+] on Apr 1, 2025
  8. melvin-bot commented on Apr 1, 2025

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 1, 2025
  10. melvin-bot commented on Apr 1, 2025

    @melvin-bot

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

  11. moved this to Bugs and Follow Up Issues in #expensify-bugson Apr 1, 2025
  12. 16 remaining items

  13. melvin-bot commented on Apr 23, 2025

    @melvin-bot

    @Pujan92 12 days overdue now... This issue's end is nigh!

  14. Pujan92 commented on Apr 24, 2025

    @Pujan92
    Contributor

    @kadiealexander Let's close this issue based on #59355 (comment)

  15. melvin-bot commented on Apr 28, 2025

    @melvin-bot

    @Pujan92 @kadiealexander this issue is now 4 weeks old, please consider:

    • Finding a contributor to fix the bug
    • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
    • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

    Thanks!

  16. melvin-bot commented on Apr 28, 2025

    @melvin-bot

    @Pujan92 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  17. melvin-bot commented on Apr 29, 2025

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  18. melvin-bot commented on Apr 30, 2025

    @melvin-bot

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

  19. melvin-bot commented on May 2, 2025

    @melvin-bot

    @Pujan92 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  20. melvin-bot commented on May 6, 2025

    @melvin-bot

    @Pujan92 10 days overdue. I'm getting more depressed than Marvin.

  21. melvin-bot commented on May 6, 2025

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  22. melvin-bot commented on May 8, 2025

    @melvin-bot

    @Pujan92 12 days overdue. Walking. Toward. The. Light...

  23. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions