Skip to content

[Due for payment 2026-03-30] Reports - After creating expense and selecting expense, footer shows $0.00 #85534

Closed

Description

@mitarachim

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.3.39-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #84910
Email or phone of affected tester (no customers): sjdoisjoisdjonsnjo@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a workspace.
  3. Go to Reports > Expenses.
  4. Open FAB > Create expense > Manual.
  5. Create a manual expense.
  6. Select the expense from Step 5 on Reports > Expenses via checkbox.

Expected Result:

Footer will show the expense amount.

Actual Result:

Footer shows $0.00.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7105274_1773751809725.1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @ShridharGoel

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Mar 17, 2026
  2. melvin-bot commented on Mar 17, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #84910

  3. melvin-bot commented on Mar 17, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Mar 17, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. MelvinBot commented on Mar 17, 2026

    @MelvinBot
    Contributor

    Proposal

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

    When a user selects an expense via checkbox on the Reports > Expenses search page, the footer shows $0.00 instead of the actual expense amount.

    What is the root cause of that problem?

    The footer total in src/pages/Search/SearchPage.tsx:121 is calculated using groupAmount:

    selectedTransactionItems.reduce((acc, transaction) => acc - (transaction.groupAmount ?? 0), 0)
    

    groupAmount is an optional backend-provided field on transactions (defined at src/types/onyx/Transaction.ts:487) that represents the amount converted to the group/policy currency. It is only returned by the backend when shouldCalculateTotals=true is sent with the search request.

    The default "Expenses" search key (CONST.SEARCH.SEARCH_KEYS.EXPENSES) is not included in the eligible search keys in src/hooks/useSearchShouldCalculateTotals.ts:19-33 — only keys like submit, approve, pay, export, etc. are eligible. So for the default Expenses search, shouldCalculateTotals=false, the backend does not populate groupAmount, and groupAmount ?? 0 evaluates to 0 for every selected transaction, resulting in a $0.00 total.

    Meanwhile, the always-available amount field on SelectedTransactionInfo (set at src/components/Search/index.tsx:140) is never used by the footer calculation.

    Additionally, PR #84910 changed the post-expense-creation navigation from Navigation.dismissModal() (which returns to the user's original search view) to Navigation.revealRouteBeforeDismissingModal(SEARCH_ROOT.getRoute({query})) (which navigates to a new generic search). This may cause the user to land on a search context where this issue is more reliably triggered.

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

    In src/pages/Search/SearchPage.tsx:121, the footer total calculation should fall back to the amount field when groupAmount is not available:

    // Before:
    acc - (transaction.groupAmount ?? 0)
    
    // After:
    acc - (transaction.groupAmount ?? transaction.amount ?? 0)
    

    Note: groupAmount is the currency-converted amount (signed negative for expenses), while amount is the raw transaction amount. The sign handling may need to match — verify that subtracting amount yields the correct positive total, and consider using Math.abs(transaction.amount) or negating it depending on the sign convention.

    What alternative solutions did you explore? (Optional)

    1. Add EXPENSES to eligibleSearchKeys in useSearchShouldCalculateTotals.ts — this would cause the backend to always compute groupAmount for default expense searches, but increases backend load for a common search type and may not be desirable.

    2. Revert the navigation change in PR [Metrics] Optimize submit-to-Search navigation performance #84910 to use dismissModal() on wide layout — this would avoid navigating to a fresh search context, but doesn't fix the underlying issue that the footer can't display correct totals when groupAmount is missing.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  6. 15 remaining items

  7. changed the title [-]Reports - After creating expense and selecting expense, footer shows $0.00[/-] [+][Due for payment 2026-03-30] Reports - After creating expense and selecting expense, footer shows $0.00[/+] on Mar 23, 2026
  8. melvin-bot commented on Mar 23, 2026

    @melvin-bot

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

  9. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.41-4 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 2026-03-30. 🎊

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

  10. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    @ShridharGoel 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]

  11. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  12. ShridharGoel commented on Mar 23, 2026

    @ShridharGoel
    Contributor

    @mallenexpensify Should we handle this as a separate task when deciding payment of the parent task? Since this was an existing bug.

  13. mallenexpensify commented on Mar 30, 2026

    @mallenexpensify
    Contributor

    @ShridharGoel can you rephrase, provide links and more detail? Thx

  14. ShridharGoel commented on Mar 31, 2026

    @ShridharGoel
    Contributor

    @mallenexpensify As mentioned in #85534 (comment), this was an existing bug which became prominent after the perf improvements done in #84910

  15. mallenexpensify commented on Apr 1, 2026

    @mallenexpensify
    Contributor

    Thanks @ShridharGoel, you reviewed the PR and did test so the standard is $250

    Payment Summary

    Contributor+: @ShridharGoel due $250 via NewDot

    cc @mountiny in case you disagree

  16. JmillsExpensify commented on Apr 6, 2026

    @JmillsExpensify
    Contributor

    $250 approved for @ShridharGoel

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

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions