Skip to content

[Due for payment 2025-11-03] [$250] Reports - Footer on "Reports", is briefly shown when submitting, approving or paying report. #70741

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: 9.2.15-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://test-management.browserstack.com/projects/2219752/test-runs/TR-828/folder/13176923/41237527/899332482
Email or phone of affected tester (no customers): ibellicotest+1811@gmail.com
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 / Android 12 / Chrome ( mWeb / Hybrid app) - Windows 11 / Chrome
App Component: Search

Action Performed:

Prerequisite: Account has at least one workspace.
Prerequisite 2: Delayed submissions and approvals enabled.

  1. Open the Expensify app.
  2. Open any workspace chat.
  3. Create at least two manual expenses.
  4. Navigate to "Reports" > "Reports"
  5. Note that no footer is displayed on section.
  6. Open the report of the just created expenses.
  7. Tap on "Submit"
  8. Return to "Reports"
  9. Note that footer with "Expenses" and "Total Spend" fields, appears and disappears.
  10. Reopen report and tap on "Approve"
  11. Return to "Reports"
  12. Note that footer appears and disappears again.

Expected Result:

Footer on "Reports" section should not be briefly displayed when an expense is submitted, approved or paid via report.

Actual Result:

After submitting, approving or paying an expense via report, and returning to "Reports" section, footer with expenses information, appears and disappears.

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

Bug6946736_1758086858634.Footer.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021970237779916738167
  • Upwork Job ID: 1970237779916738167
  • Last Price Increase: 2025-09-22
Issue OwnerCurrent Issue Owner: @trjExpensify / @stephanieelliott
Issue OwnerCurrent Issue Owner: @trjExpensify / @stephanieelliott

Activity

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

    @melvin-bot

    Triggered auto assignment to @stephanieelliott (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. bernhardoj commented on Sep 17, 2025

    @bernhardoj
    Contributor

    Proposal

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

    Total footer shown briefly after submit, approve, or pay report.

    What is the root cause of that problem?

    When we submit, approve, or pay, we trigger the search API and pass the shouldCalculateTotals as true.

    if (currentSearchQueryJSON) {
    search({
    searchKey: currentSearchKey,
    shouldCalculateTotals: true,

    When we go back, another search API is triggered with shouldCalculateTotals as false, as decided here.

    const shouldCalculateTotals = useMemo(() => {
    if (offset !== 0) {
    return false;
    }
    const savedSearchValues = Object.values(savedSearches ?? {});
    if (!savedSearchValues.length && !searchKey) {
    return false;
    }
    const eligibleSearchKeys: Partial<SearchKey[]> = [
    CONST.SEARCH.SEARCH_KEYS.SUBMIT,
    CONST.SEARCH.SEARCH_KEYS.APPROVE,
    CONST.SEARCH.SEARCH_KEYS.PAY,
    CONST.SEARCH.SEARCH_KEYS.EXPORT,
    CONST.SEARCH.SEARCH_KEYS.STATEMENTS,
    CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CASH,
    CONST.SEARCH.SEARCH_KEYS.UNAPPROVED_CARD,
    CONST.SEARCH.SEARCH_KEYS.RECONCILIATION,
    ];
    if (eligibleSearchKeys.includes(searchKey)) {
    return true;
    }
    for (const savedSearch of savedSearchValues) {
    const searchData = buildSearchQueryJSON(savedSearch.query);
    if (searchData && searchData.similarSearchHash === similarSearchHash) {
    return true;
    }
    }
    return false;
    }, [offset, savedSearches, searchKey, similarSearchHash]);

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

    We need to use the same shouldCalculateTotals from Search/index component in MoneyReportHeader. To make it DRY, we can either create a util or a hook (useSearchShouldCalculateTotals). Every data can be get from the SearchContext, except the offset.

    const shouldCalculateTotals = useMemo(() => {
    if (offset !== 0) {
    return false;
    }

    To fix that, we can move the offset state to the SearchContext and name it currentOffset.

    const [offset, setOffset] = useState(0);

    We can reset the offset here.

    const clearTransactionsAndSetHashAndKey = useCallback(() => {
    clearSelectedTransactions(hash);
    setCurrentSearchHashAndKey(hash, searchKey);
    setCurrentSearchQueryJSON(queryJSON);
    }, [hash, searchKey, clearSelectedTransactions, setCurrentSearchHashAndKey, setCurrentSearchQueryJSON, queryJSON]);
    useFocusEffect(clearTransactionsAndSetHashAndKey);
    useEffect(() => {
    clearTransactionsAndSetHashAndKey();
    // Trigger once on mount (e.g., on page reload), when RHP is open and screen is not focused
    // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
    }, []);

    But I don't think making the offset global is a good idea. Maybe we can check the offset only in Search/index file. Let me know which one is preferable.

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

    N/A

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 22, 2025
  5. changed the title [-]Reports - Footer on "Reports", is briefly shown when submitting, approving or paying report.[/-] [+][$250] Reports - Footer on "Reports", is briefly shown when submitting, approving or paying report.[/+] on Sep 22, 2025
  6. melvin-bot commented on Sep 22, 2025

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

    @melvin-bot

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

  9. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 22, 2025
  10. 38 remaining items

  11. changed the title [-][$250] Reports - Footer on "Reports", is briefly shown when submitting, approving or paying report.[/-] [+][Due for payment 2025-11-03] [$250] Reports - Footer on "Reports", is briefly shown when submitting, approving or paying report.[/+] on Oct 27, 2025
  12. melvin-bot commented on Oct 27, 2025

    @melvin-bot

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

  13. melvin-bot commented on Oct 27, 2025

    @melvin-bot

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

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

  14. melvin-bot commented on Oct 27, 2025

    @melvin-bot

    @allroundexperts / @bernhardoj @trjExpensify / @stephanieelliott 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]

  15. allroundexperts commented on Nov 3, 2025

    @allroundexperts
    Contributor

    BugZero Checklist:

    • [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/68770/files#r2487961951

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

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

    • N/A

    Test:

    1. Create an expense in a WS chat and submit it
    2. Open Reports > Reports
    3. Open the expense report
    4. Approve the report
    5. Go back

    Verify there is no Reports footer shows briefly

    Do we agree 👍 or 👎

  16. melvin-bot commented on Nov 3, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@trjExpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1970237779916738167/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  17. trjExpensify commented on Nov 4, 2025

    @trjExpensify
    Contributor

    Caught from an existing test case. Payment summary as follows:

    Go ahead and request. Closing!

  18. bernhardoj commented on Nov 4, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  19. garrettmknight commented on Nov 21, 2025

    @garrettmknight
    Contributor

    $250 approved for @bernhardoj

  20. trjExpensify commented on Jan 5, 2026

    @trjExpensify
    Contributor

    approved $250 for @allroundexperts.

  21. garrettmknight commented on Jan 5, 2026

    @garrettmknight
    Contributor
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