Skip to content

[Insights] Reports - Expense report does not open #80814

Closed

Description

@vincdargento

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.3.11-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: https://test-management.browserstack.com/projects/2219752/folder/13176730/test-cases/41237110
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 11, Chrome
App Component: Other

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Create an expense in a WS
  3. Navigate to Reports > Reports
  4. Click to open an expense report

Expected Result:

Expense reports should open normally when accessed from the Reports section.

Actual Result:

After clicking on an Expense report, the report does not open.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Activity

  1. melvin-bot commented on Jan 28, 2026

    @melvin-bot

    Triggered auto assignment to @marcochavezf (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  2. melvin-bot commented on Jan 28, 2026

    @melvin-bot

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

  3. github-actions commented on Jan 28, 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.
  4. OSBotify commented on Jan 28, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #80684 - "Add support for groupBy week in Search" by @mountiny (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #80684 introduced a logic error that breaks expense report navigation from the Reports page.

    Labels: No label changes needed - issue is correctly labeled as DeployBlockerCash

    Detailed Analysis

    Evidence

    PR #80684 was merged at 2026-01-28T22:20:07Z, just 27 minutes before the staging deploy was cut at 2026-01-28T22:47:05Z. The PR added support for grouping by week in Search functionality.

    The PR modified src/components/Search/index.tsx and introduced a critical bug in the onSelectRow callback function around line 937-939:

    // After handling all group types, item should be TransactionListItemType or ReportActionListItemType
    if (!isTransactionItem && !isReportActionListItemType(item)) {
        return;
    }

    This early return check was placed AFTER handling various group types (member, card, withdrawal, category, merchant, tag, month, week) but BEFORE the crucial check for TransactionGroupListItemType (expense reports) at line 965.

    Verification

    When a user clicks on an expense report from the Reports > Reports page:

    1. The item is of type TransactionGroupListItemType (an expense report)
    2. The code processes all the specific group type checks (lines 809-934)
    3. At line 937, the code checks if the item is NOT a transaction item AND NOT a report action
    4. Since TransactionGroupListItemType items are neither of those types, the function returns early
    5. The navigation logic at line 965 that would handle TransactionGroupListItemType is never reached
    6. Result: The report does not open - exactly matching the reported bug

    The affected file: /home/runner/work/App/App/src/components/Search/index.tsx

    Root Cause

    The developer added a type-safety check comment "After handling all group types, item should be TransactionListItemType or ReportActionListItemType" and an early return, but this assumption is incorrect. The function still needs to handle TransactionGroupListItemType items (expense reports), which are processed later in the code at line 965.

    The early return at line 937-939 prevents all expense reports from being opened when clicked from the Reports page.

  5. puneetlath commented on Jan 28, 2026

    @puneetlath
    Contributor

    Drafted a revert to see if it's definitely caused by that PR: #80824

  6. self-assigned this
    on Jan 29, 2026
  7. 8 remaining items

  8. melvin-bot commented on Jan 29, 2026

    @melvin-bot

    Triggered auto assignment to @flodnv (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  9. melvin-bot commented on Jan 29, 2026

    @melvin-bot

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

  10. github-actions commented on Jan 29, 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.
  11. OSBotify commented on Jan 29, 2026

    @OSBotify
    Contributor

    Investigation Status Update

    The previous investigation by OSBotify was correct and the revert has been successfully merged.

    Current Status:

    Classification Confirmation: Frontend bug (App repository)

    The investigation found that PR #80684 introduced a logic error in /home/runner/work/App/App/src/components/Search/index.tsx where an early return statement was added that prevented TransactionGroupListItemType items (expense reports) from being handled properly. This caused expense reports to not open when clicked from the Reports page.

    The revert removes this problematic code and should restore the expected functionality.

    No further action needed - the blocker label should remain until the revert is verified on staging.

  12. marcochavezf commented on Jan 29, 2026

    @marcochavezf
    Contributor

    AI analysis:


    Most Likely Offending PR: #80613 - "Fix SearchMoneyRequestReport page calls openReport at least once"

    This PR directly modified SearchMoneyRequestReportPage.tsx, which is the exact page that handles opening expense reports from the Reports section.

    The Changes Made

    Original code:

    if (visibleTransactions.length > 2) {
        return;
    }
    // ...
    openReport(reportIDFromRoute, ...);

    New code:

    const isInitialMountRef = useRef(true);
    const prevReportIDFromRoute = usePrevious(reportIDFromRoute);
    
    useEffect(() => {
        if (prevReportIDFromRoute !== reportIDFromRoute) {
            isInitialMountRef.current = true;
        }
        
        if (visibleTransactions.length > 2 && !isInitialMountRef.current) {
            return;
        }
        // ...
        openReport(reportIDFromRoute, ...);
        isInitialMountRef.current = false;
    }, [reportIDFromRoute, transactionThreadReportID, oneTransactionID]);

    Potential Issue

    The logic using prevReportIDFromRoute and isInitialMountRef may have a race condition or edge case where:

    1. On first render, prevReportIDFromRoute from usePrevious could return the same value as reportIDFromRoute in some navigation scenarios (especially when navigating from within Reports)
    2. If prevReportIDFromRoute === reportIDFromRoute on initial navigation, isInitialMountRef.current won't be reset to true
    3. Combined with visibleTransactions.length > 2, this could cause openReport to never be called

    Secondary Suspects

    1. [HomePage] Foundation: Add Home Navigation (1/2) - Core #80504 / [No QA][Home Page] Foundation: Add Home Navigation (2/2) - Rename the home directory to inbox #80571 - Home Navigation changes that significantly modified navigation components and routes. Could affect how the Reports section navigates to expense reports.

    2. Add support for groupBy week in Search #80684 - "Add support for groupBy week in Search" - This was already reverted via #80824, suggesting it caused issues. If the revert wasn't complete or introduced its own issues, it could be related.

    Recommendation

    Start by investigating PR #80613 since it directly touches the report opening logic. The usePrevious hook behavior when navigating from within the same screen type could be the root cause.


    cc @collectioneur @ZhenjaHorbach @blazejkustra

  13. ZhenjaHorbach commented on Jan 29, 2026

    @ZhenjaHorbach
    Contributor

    AI analysis:

    Most Likely Offending PR: #80613 - "Fix SearchMoneyRequestReport page calls openReport at least once"

    This PR directly modified SearchMoneyRequestReportPage.tsx, which is the exact page that handles opening expense reports from the Reports section.

    But a report (where we updated the code) was not even opened in the bug
    So I'm not sure if that is related to our changes

    But I actually can't reproduce to confirm this

  14. cristipaval commented on Jan 29, 2026

    @cristipaval
    Contributor

    the revert PR should hit the staging soon

  15. cristipaval commented on Jan 29, 2026

    @cristipaval
    Contributor

    Why did we remove the blocker label from this one?

    we merged the revert yesterday but forgot to CP it 🤦‍♂️
    Sorry!

  16. neil-marcellini commented on Jan 29, 2026

    @neil-marcellini
    Contributor

    revert PR is on staging

  17. collectioneur commented on Jan 30, 2026

    @collectioneur
    Contributor

    AI analysis:

    Most Likely Offending PR: #80613 - "Fix SearchMoneyRequestReport page calls openReport at least once"

    This PR directly modified SearchMoneyRequestReportPage.tsx, which is the exact page that handles opening expense reports from the Reports section.

    I agree with @ZhenjaHorbach. My PR isn't related to this issue because the report itself doesn't even open. For my changes to take effect, the report needs to open at least for a millisecond. The investigation should probably focus on the search page, since the navigation to the report is supposed to happen there upon clicking the button.

  18. melvin-bot commented on Jan 31, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions