Skip to content

[Due for payment 2025-08-01] [$250] Expense - Hold expense header displays "all expenses were put on hold" #65725

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.78-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/6456836
Email or phone of affected tester (no customers): Slottwo1 csm@gmail.com
Issue reported by: Applause Internal Team
Device used: Redminote 10s android 13
App Component: Money Requests

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Create a workspace and enable approvals
  3. Navigate to a workspace chat
  4. Create 2 scan expenses and wait for the smartscan
  5. Create a manual expense
  6. The report should contain 2 scanned expenses and 1 manual
  7. Submit the report with the 3 expenses
  8. Navigate to one of the scanned expenses
  9. Hold the scanned expense
  10. Click on the approve button
  11. Verify the approve modal is displayed so the user can select with amount to approve (total or only unheld expenses)
  12. Click on the option to approve only the unheld expenses
  13. Verify the report is approved with the 2 expenses that were unheld
  14. Verify a new report is created with the held scan expens
  15. Open the expense

Expected Result:

Hold expense header must display "this expense was put on hold".

Actual Result:

Hold expense header displays "all expenses were put on hold" instead "this expense was put on hold".

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021943391641851063523
  • Upwork Job ID: 1943391641851063523
  • Last Price Increase: 2025-07-10
Issue OwnerCurrent Issue Owner: @abekkala

Activity

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

    @melvin-bot

    Triggered auto assignment to @abekkala (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. thelullabyy commented on Jul 9, 2025

    @thelullabyy
    Contributor

    Proposal

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

    Hold expense header displays "all expenses were put on hold" instead "this expense was put on hold".

    What is the root cause of that problem?

    In one expense report view, we always display expensesOnHold translation

    if (hasOnlyHeldExpenses) {
    return {icon: getStatusIcon(Expensicons.Stopwatch), description: translate('iou.expensesOnHold')};
    }

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

    We should display expenseOnHold description if we only have one expense

    return {icon: getStatusIcon(Expensicons.Stopwatch), description: translate(transactions.length > 1 ? 'iou.expensesOnHold' : 'iou.expenseOnHold')};
    

    if (hasOnlyHeldExpenses) {
    return {icon: getStatusIcon(Expensicons.Stopwatch), description: translate('iou.expensesOnHold')};
    }

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

    NA

    What alternative solutions did you explore? (Optional)

    NA

    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. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 10, 2025
  5. changed the title [-]Expense - Hold expense header displays "all expenses were put on hold"[/-] [+][$250] Expense - Hold expense header displays "all expenses were put on hold"[/+] on Jul 10, 2025
  6. melvin-bot commented on Jul 10, 2025

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

    @melvin-bot

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

  9. huult commented on Jul 11, 2025

    @huult
    Contributor

    Proposal

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

    Hold expense header displays "all expenses were put on hold"

    What is the root cause of that problem?

    We always show expensesOnHold if hasOnlyHeldExpenses is true.

    if (hasOnlyHeldExpenses) {
    return {icon: getStatusIcon(Expensicons.Stopwatch), description: translate('iou.expensesOnHold')};
    }

    And the case where we have only one report transaction is not handled yet

    return reportTransactions.length > 0 && !reportTransactions.some((transaction) => !isOnHoldTransactionUtils(transaction));

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

    To resolve this issue, we need to add a new case for when there is only one report transaction. The implementation should look like this:

    1. Create new function to check

    add

    function hasOnlyHeldExpense(iouReportID?: string, allReportTransactions?: SearchTransaction[]): boolean {
        const transactionsByIouReportID = getReportTransactions(iouReportID);
        const reportTransactions = allReportTransactions ?? transactionsByIouReportID;
        return reportTransactions.length === 1 && !reportTransactions.some((transaction) => !isOnHoldTransactionUtils(transaction));
    }

    2 Check is hasOnlyHeldExpense then return expenseOnHold

    add

        const hasOnlyHeldExpense = hasOnlyHeldExpenseReportUtils(moneyRequestReport?.reportID);
         if (hasOnlyHeldExpense) {
                return {icon: getStatusIcon(Expensicons.Stopwatch), description: translate('iou.expenseOnHold')};
            }

    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)

    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.

  10. jayeshmangwani commented on Jul 12, 2025

    @jayeshmangwani
    Contributor

    @huult , we already have one proposal #65725 (comment) above suggesting that we should check whether transactions.length > 1, and if so, display expensesOnHold; otherwise, show expenseOnHold. From your proposal, it seems like you're suggesting something similar - just wanted to confirm what exactly you're proposing that's different from the above?

  11. huult commented on Jul 14, 2025

    @huult
    Contributor

    @jayeshmangwani I based the logic of the function hasOnlyHeldExpenses to check single report transactions by length = 1, then return the exact transaction.

    just wanted to confirm what exactly you're proposing that's different from the above?

    It looks like this is the same thing.

  12. jayeshmangwani commented on Jul 15, 2025

    @jayeshmangwani
    Contributor

    @huult , thanks for your proposal and explanation. I think this issue is fairly straightforward, and since both proposed solutions are quite similar, we can go ahead with the first one in this case.

  13. 14 remaining items

  14. changed the title [-][$250] Expense - Hold expense header displays "all expenses were put on hold"[/-] [+][Due for payment 2025-08-01] [$250] Expense - Hold expense header displays "all expenses were put on hold"[/+] on Jul 25, 2025
  15. melvin-bot commented on Jul 25, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  16. melvin-bot commented on Jul 25, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.85-5 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 2025-08-01. 🎊

    For reference, here are some details about the assignees on this issue:

  17. melvin-bot commented on Jul 25, 2025

    @melvin-bot

    @jayeshmangwani @abekkala The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  18. abekkala commented on Jul 25, 2025

    @abekkala
    Contributor

    PAYMENT SUMMARY FOR AUG 01

  19. abekkala commented on Aug 1, 2025

    @abekkala
    Contributor

    @thelullabyy payment sent and contract ended - thank you! 🎉

  20. jayeshmangwani commented on Aug 1, 2025

    @jayeshmangwani
    Contributor

    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: Feature: Hold expense in one transaction view v2 #43618

    • [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: N/A

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

    Not sure we need a dedicated regression test for this, but if we decide to add one, I think the steps below should cover it. Here's what I'm suggesting:

    Regression Test Proposal

    1. Open the app
    2. Create a workspace and enable approvals
    3. Navigate to a workspace chat
    4. Create 2 scan expenses and wait for the smartscan
    5. Create a manual expense
    6. The report should contain 2 scanned expenses and 1 manual
    7. Submit the report with the 3 expenses
    8. Navigate to one of the scanned expenses
    9. Hold the scanned expense
    10. Click on the approve button
    11. Verify the approve modal is displayed so the user can select with amount to approve (total or only unheld expenses)
    12. Click on the option to approve only the unheld expenses
    13. Verify the report is approved with the 2 expenses that were unheld
    14. Verify a new report is created with the held scan expens
    15. Open the expense
    16. Verify hold expense header display "this expense was put on hold".

    Do we agree 👍 or 👎

  21. abekkala commented on Aug 1, 2025

    @abekkala
    Contributor

    PAYMENT SUMMARY FOR AUG 01

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions