Skip to content

Android - Reports - Expense row is not higlighted after creating expense #85640

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: 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): sdjsdjosijnsodiosd@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Samsung Galaxy S25 FE / Android 16
App Component: Search

Action Performed:

  1. Launch Expensify app.
  2. Go to Reports > Expenses.
  3. Open FAB > Create expense > Manual.
  4. Create a manual expense.

Expected Result:

Expense row will be highlighted.

Actual Result:

Expense row is not higlighted after creating expense.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Video.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.
    on Mar 18, 2026
  2. melvin-bot commented on Mar 18, 2026

    @melvin-bot

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

  3. melvin-bot commented on Mar 18, 2026

    @melvin-bot

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

  4. github-actions commented on Mar 18, 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. OSBotify commented on Mar 18, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #84910 - "Optimize submit-to-Search navigation performance" by @JakubKorytko (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #84910 refactored the highlight logic in SearchList but introduced a bug by omitting canSelectMultiple from the renderItem dependency array, causing stale closure references that break the expense row highlighting functionality.

    Labels: Keeping DeployBlockerCash (frontend bug in App). No label changes needed as the issue is correctly labeled.

    📋 Detailed Analysis

    Evidence

    PR #84910 was a performance optimization that refactored how selection state is applied to search list items. The PR is the only one in the staging deploy that modifies the Search list rendering logic, and the bug reproduces only on staging (where this PR is deployed) but not production.

    Verification

    The bug affects expense row highlighting after creation in the Search component. PR #84910 modified the following key files:

    • src/components/Search/SearchList/index.tsx - The core file where the bug exists
    • src/components/Search/index.tsx - Parent component
    • Multiple search-related components

    The changes in SearchList/index.tsx show:

    Before PR #84910:

    const itemsWithSelection = useMemo(() => 
      data.map((item) => applySelectionToItem(item, canSelectMultiple, selectedTransactions)), 
      [data, canSelectMultiple, selectedTransactions]
    );
    
    // In renderItem:
    const itemData = itemsWithSelection.at(index);
    const itemWithSelection = itemData?.itemWithSelection ?? item;

    After PR #84910:

    // itemsWithSelection memo was removed
    
    // In renderItem (line 426):
    const {itemWithSelection} = applySelectionToItem(item, canSelectMultiple, selectedTransactions);
    
    // Dependency array (lines 467-496):
    [
      type,
      groupBy,
      newTransactionIDByItemKey,
      shouldAnimate,
      data.length,
      // ... other deps ...
      selectedTransactions,  // Added
      // canSelectMultiple is MISSING!
    ]

    Root Cause

    The refactoring moved applySelectionToItem from a separate memoized structure into the renderItem callback. However, canSelectMultiple is used inside renderItem (line 426) but was not added to the dependency array (lines 467-496).

    This creates a stale closure: when canSelectMultiple changes, renderItem is not recreated, so it continues using the old value. This breaks the selection/highlight logic that determines which expense rows should be highlighted.

    While selectedTransactions was correctly added to the dependency array (line 495), the omission of canSelectMultiple causes the highlighting to fail.

  6. MelvinBot commented on Mar 18, 2026

    @MelvinBot
    Contributor

    I have failed to help you. I let you down and for that I am sorry. Please try again later. This may be due to a Claude outage (check here).

    Failure details: https://github.com/Expensify/Expensify/actions/runs/23244292241

  7. mountiny commented on Mar 18, 2026

    @mountiny
    Contributor

    We already have an issue for it here #85521 - it is a race condition that became more apparent after making this flow faster. I dont think we need to block on this

  8. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Mar 18, 2026
  9. melvin-bot commented on Mar 26, 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

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions