Skip to content

[Due for Payment 2026-03-17][$250] Web - Expense - Approve button is present after submitting a scan expense with missing amount #67173

Closed

Description

@nlemma

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.86-2
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://github.com/Expensify/Expensify/issues/495513
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Windows 11 Pro - Chrome
App Component: Other

Action Performed:

Pre-conditions: Have a workspace with Delay submissions set manually and Add approvals set with an approver.

  1. Navigate to staging.new.expensify.com
  2. Create a scan receipt that is missing the amount and not missing the merchant
  3. After the scan is complete, submit the expense
  4. [Approver] Verify that after submitting, the approve button doesn't appear

Expected Result:

After submitting, the approve button doesn't appear.

Actual Result:

The approve button is present after submitting a scan expense with a missing amount.

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

Bug6895959_1753246563762.Approve_button.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021949894641800532742
  • Upwork Job ID: 1949894641800532742
  • Last Price Increase: 2025-07-28
  • Automatic offers:
    • mkzie2 | Contributor | 108293311
Issue OwnerCurrent Issue Owner: @ZhenjaHorbach

Activity

  1. added
    Daily
    Bug
    on Jul 25, 2025
  2. melvin-bot commented on Jul 25, 2025

    @melvin-bot

    Triggered auto assignment to @OfstadC (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. mkzie2 commented on Jul 25, 2025

    @mkzie2
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-07-31 10:44:12 UTC.

    Proposal

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

    The approve button is present after submitting a scan expense with a missing amount.

    What is the root cause of that problem?

    We don't have the logic to prevent the approve action if we only have the scan request with missing value. We only check the pending card transactions.

    if (reportTransactions.length > 0 && reportTransactions.every((transaction) => isPending(transaction))) {
    return false;
    }

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

    We can use isPendingCardOrScanningTransaction to check if every transactions are pending card or scan request without amount like we do here

    if (reportTransactions.length > 0 && reportTransactions.every((transaction) => isPendingCardOrScanningTransaction(transaction))) {
        return false;
    }
    

    if (reportTransactions.length > 0 && reportTransactions.every((transaction) => isPending(transaction))) {
    return false;
    }

    We should do the same for secondary action and preview action. We can also do this for submit action, but the submit action is a bit different, I tested and we only don't allow submitting if the scan request is missing both amount and merchant.

    To fix the next step, we can check if all transactions are pending card or scanning transaction, and we can display an optimistic next step Waiting for you to fix the issue(s) the same as buildOptimisticNextStepForPreventSelfApprovalsEnabled

    const optimisticNextStep = isSubmitterSameAsNextApprover && policy?.preventSelfApproval ? buildOptimisticNextStepForPreventSelfApprovalsEnabled() : nextStep;

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

    Update ReportPrimaryActionUtils test accordingly for approve action to verify the approve action isn't inclued if all transactions are pending or scan request without amount.

    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. samranahm commented on Jul 25, 2025

    @samranahm
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-08-01 10:02:48 UTC.

    Proposal

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

    Web - Expense - Approve button is present after submitting a scan expense with missing amount

    What is the root cause of that problem?

    We are currently not checking the report total and return true if the report is processing here

    return isProcessingReportUtils(report);
    }

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

    we should explicitly check the report total with report?.total === 0

    here

    if (!isExpenseReport || !isApprovalEnabled || reportTransactions.length === 0) {
    return false;
    }

        if (!isExpenseReport || !isApprovalEnabled || reportTransactions.length === 0 || report?.total === 0) {
            return false;
        }

    like we did in isSubmitAction here

    if (!isExpenseReport || report?.total === 0) {
    return false;
    }

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

    We should update the ReportPrimaryActionUtilsTest to include this check

    What alternative solutions did you explore? (Optional)

    we can add this check in final return

        return isProcessingReportUtils(report) && report?.total !== 0;

    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.

  5. added
    External
    on Jul 28, 2025
  6. changed the title [-]Web - Expense - Approve button is present after submitting a scan expense with missing amount[/-] [+][$250] Web - Expense - Approve button is present after submitting a scan expense with missing amount[/+] on Jul 28, 2025
  7. melvin-bot commented on Jul 28, 2025

    @melvin-bot
  8. added
    Help Wanted
    on Jul 28, 2025
  9. melvin-bot commented on Jul 28, 2025

    @melvin-bot

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

  10. ZhenjaHorbach commented on Jul 31, 2025

    @ZhenjaHorbach
    Contributor

    Thanks for your proposals !
    All proposals look good
    But we need to fix also an issue when we have Waiting for you to approve expense(s) message
    And in this case we need to show Waiting for you to fix the issue(s) message because we still won't be able to approve until we fix the amount

    Could you update your proposals ?

    Image
  11. 34 remaining items

  12. removed
    Reviewing
    on Mar 17, 2026
  13. changed the title [-][Hold][$250] Web - Expense - Approve button is present after submitting a scan expense with missing amount[/-] [+][$250] Web - Expense - Approve button is present after submitting a scan expense with missing amount[/+] on Mar 17, 2026
  14. added
    Daily
    Awaiting Payment
    and removed on Mar 17, 2026
  15. melvin-bot commented on Mar 17, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  16. mallenexpensify commented on Mar 17, 2026

    @mallenexpensify
    Contributor

    @jasperhuangg , @ZhenjaHorbach mentioned

    Here is one regression, but since the requirements for the PR have changed several times, as a result of which the PR has been delayed, I think it will be better to leave the price unchanged

    Do you agree?

  17. changed the title [-][$250] Web - Expense - Approve button is present after submitting a scan expense with missing amount[/-] [+][Due for Payment 2026-03-17][$250] Web - Expense - Approve button is present after submitting a scan expense with missing amount[/+] on Mar 17, 2026
  18. jasperhuangg commented on Mar 17, 2026

    @jasperhuangg
    Contributor

    I'm fine with that, checking with @trjExpensify since he was helping to do the product review which surfaced most of the requirements changes.

  19. trjExpensify commented on Mar 17, 2026

    @trjExpensify
    Contributor

    Yeah, fine with that. These two issues came throughout the course of this one which had an impact on it to iron out the actual expected behaviour:

    https://github.com/Expensify/Expensify/issues/531162
    #70112

  20. mallenexpensify commented on Mar 17, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @mkzie2 paid $250 via Upwork
    Contributor+: @ZhenjaHorbach due $250 via NewDot

    ^ Test case created

    Thanks y'all!

  21. garrettmknight commented on Mar 18, 2026

    @garrettmknight
    Contributor

    $250 approved for @ZhenjaHorbach

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions