Skip to content

[Due for payment 2026-09-17] Report - Existing expenses added to report are not highlighted. #100789

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.75-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: #98744
Email or phone of affected tester (no customers): ibellicotest+2766@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Money Requests

Action Performed:

Prerequisite: Account has Self DM.
Prerequisite 2: Account has a workspace.

  1. Open the staging.new.expensify.com website.
  2. Navigate to Self DM.
  3. Create two manual expenses.
  4. Navigate to workspace chat.
  5. Create an empty report.
  6. Open the just created report.
  7. Click on "Add Expense" > "Add existing expense"
  8. Select both expenses created on Self DM > "Add to report"
  9. Note that expenses are not highlighted after being added to report.

Expected Result:

Existing expenses added to report should be automatically highlighted.

Actual Result:

Existing expenses added to report are not displayed highlighted.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7255732_1789012334037.Existing.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7255732

Issue OwnerCurrent Issue Owner: @abzokhattab

Activity

  1. applause-bot commented on Sep 10, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/e4523487e435c6b5a065ccc82ccdc5efaeb8a1f4755de373e8eaafec0e9a49fb

  2. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 10, 2026
  3. melvin-bot commented on Sep 10, 2026

    @melvin-bot

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

  4. github-actions commented on Sep 10, 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. melvin-bot commented on Sep 10, 2026

    @melvin-bot

    @blimpich @abzokhattab you have been assigned to this deploy blocker because you reviewed the offending PR: #98744

  6. melvin-bot commented on Sep 10, 2026

    @melvin-bot

    @TaduJR you have been assigned to this deploy blocker because you authored the offending PR: #98744

  7. melvin-bot commented on Sep 10, 2026

    @melvin-bot

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

  8. MelvinBot commented on Sep 10, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #98744 - "refactor: the new-transaction highlight rail and the wide RHP width model" by @TaduJR (High confidence)
    Related Issues: #100787, #100763, #100761, #100757 (all auto-assigned to the same PR), and likely #100788

    Recommendation: REVERT

    PR #98744 introduced a new isHydratingFromEmpty heuristic in useNewTransactions that suppresses the highlight whenever a report's transaction list grows from 0 to 2+ rows at once — exactly this repro (empty report + adding two existing expenses in one action). With five other highlight-related deploy blockers on this same PR, a revert is safer and faster than patching each symptom individually; the PR was explicitly a behaviour-preserving refactor, so reverting loses no user-facing functionality.

    Assigned: @TaduJR (PR author), @blimpich and @abzokhattab (approving reviewers) from the causing PR — already assigned by Melvin.
    Labels: No changes. DeployBlockerCash is kept (App PR is the cause). DeployBlocker was not present, so nothing was removed.

    📋 Detailed Analysis

    Evidence

    Verification

    Affected file: src/hooks/useNewTransactions.ts, consumed by MoneyRequestReportActionsList.tsx#L160.

    Confirmed #98744 modifies it — src/hooks/useNewTransactions.ts is in the PR's file list (+127/−56), and git log on staging shows every recent commit to that file belongs to this PR. No commit after the merge (3aaa7f7) has touched useNewTransactions.ts, useAnimatedHighlightStyle/index.ts, or WideRHPContextProvider/index.tsx, so a revert should apply cleanly.

    Root Cause

    src/hooks/useNewTransactions.ts#L66-L73:

    const hasReplacedBaseline = baselineSourceIDs.length > 0 && !trackedTransactionIDs.some((transactionID) => baselineIDs.has(transactionID));
    // "Shares nothing" says nothing against an empty baseline, so the count decides: a user adds one row at a time, several at once is the report loading.
    const isHydratingFromEmpty = baselineSourceIDs.length === 0 && trackedTransactionIDs.length > 1;
    if (!hasSettledAfterInitialLoad) {
        setHasSettledAfterInitialLoad(true);
    } else if (!hasReplacedBaseline && !isHydratingFromEmpty) {
        addedIDs = trackedTransactionIDs.filter((transactionID) => !baselineIDs.has(transactionID));
    }

    Walking the repro:

    1. The empty report is opened, so the diff baseline settles at sourceIDs = [].
    2. "Add to report" applies one optimistic Onyx update containing both transactions, so the list jumps [] → [t1, t2] in a single render.
    3. baselineSourceIDs.length === 0 and trackedTransactionIDs.length === 2 > 1, so isHydratingFromEmpty is true.
    4. addedIDs stays EMPTY_TRANSACTION_IDS, newTransactions is empty, and no row is highlighted.

    The heuristic's assumption — "several rows appearing at once against an empty baseline means the report is loading" — is wrong for any bulk add into an empty report. The rail (pendingNewTransactionIDs) can't rescue it because the move flow never writes a flag.

    Note the bug is specific to 2+ rows: adding a single existing expense to an empty report still highlights, which is why the tester had to select both expenses to see it.

    For comparison, the pre-PR implementation had no such suppression — it simply diffed transactions.length > prevTransactions.length and returned every ID not in the previous list, so both rows highlighted. That is why production is unaffected.

    If a roll-forward is preferred over a revert

    The minimal targeted fix is to stop using row count as the load-vs-user-action discriminator. Genuine user adds arrive optimistically with pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, whereas a hydrating list arrives from the server with no pending action, so isHydratingFromEmpty should additionally require that none of the newly appeared transactions is pending. Given the four other blockers filed against the same refactor, though, reverting is likely to be the cheaper path.

  9. melvin-bot commented on Sep 10, 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.

  10. IuliiaHerets commented on Sep 10, 2026

    @IuliiaHerets

    This issue is not repro on Windows 10/Chrome Build v9.4.75-1

    Recording.1574.mp4
  11. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Sep 10, 2026
  12. changed the title [-]Report - Existing expenses added to report are not highlighted.[/-] [+][Due for payment 2026-09-17] Report - Existing expenses added to report are not highlighted.[/+] on Sep 10, 2026
  13. melvin-bot commented on Sep 10, 2026

    @melvin-bot

    @abzokhattab / @TaduJR

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.75-3 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-09-17. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]

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