Skip to content

[Due for payment 2026-08-25] Spend - Expenses count does not update after adding expense to report #98698

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.54-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: #98558
Email or phone of affected tester (no customers): sjodindjsosjnnsjiojo@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create an empty report in workspace chat.
  3. Create an expense in self DM.
  4. Go to Spend > Reports.
  5. Select the report via checkbox.
  6. Open the report.
  7. Click Add expense > Add existing expense.
  8. Select self DM expense > Add to report.
  9. Close the report.

Expected Result:

Expenses count will update after adding expense to report.

Actual Result:

Expenses count does not update after adding expense to report.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7233941_1786743963405.7.mp4

View all open jobs on GitHub

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

Issue OwnerCurrent Issue Owner: @QichenZhu

Activity

  1. applause-bot commented on Aug 14, 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/dd24092922672a790ab884454039d1402b96de3da5847215916c55e85c59e0a5

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

    @melvin-bot

    @mountiny recently merged #98558, but they are OOO right now, so I'll auto-assign someone else.

  4. github-actions commented on Aug 14, 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 Aug 14, 2026

    @melvin-bot

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

  6. melvin-bot commented on Aug 14, 2026

    @melvin-bot

    @mountiny @QichenZhu you have been assigned to this deploy blocker because you reviewed the offending PR: #98558

  7. melvin-bot commented on Aug 14, 2026

    @melvin-bot

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

  8. melvin-bot commented on Aug 14, 2026

    @melvin-bot

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

  9. MelvinBot commented on Aug 14, 2026

    @MelvinBot
    Contributor

    Deploy Blocker Analysis

    Root cause: Expensify/App#98558 (the reland of the Search re-fire optimization) narrowed when the Search snapshot refetches. In Spend > Reports, the "Expenses" count is read straight from the Search snapshot (getExpenseReportRowDisplayValues.ts:30), so it only changes when a refetch fires. "Add existing expense to report" fires no refetch, so the count stays stale. Confidence: High.

    Recommended fix: Revert Expensify/App#98558 to unblock the deploy (it has already been through one revert/reland cycle). A roll-forward that keeps the optimization is possible but needs regression coverage — details below.

    Investigation details

    Why it broke. Before this PR, useSearchHighlightAndScroll refetched the snapshot on any report-action change for all search types (hasReportActionsIDsChange). Adding an expense to a report emits report actions, so the Reports view refetched and the count updated. The PR gated report-action refetches to chat searches only and replaced the broad trigger with a narrow transaction-based one:

    • useSearchHighlightAndScroll.ts:110 — trigger is now isChat ? hasReportActionsIDsChange : hasTransactionsIDsChange || hasChangedResultTransaction. For non-chat (Reports) searches, report actions no longer trigger a refetch.
    • useSearchHighlightAndScroll.ts:392-417 — the replacement non-chat trigger (hasChangedTransactionInSearchResults) only fires when a changed transaction's ID is already present in the current search results (searchResultIDs.has(transactionID)).

    Why the failing flow slips through. "Add existing expense" moves a pre-existing self-DM expense into a report:

    • No transaction is created/deleted → hasTransactionsIDsChange = false.
    • The moved transaction wasn't among the target report's displayed transactions before the move → not in searchResultIDs → hasChangedResultTransaction = false.
    • Report-action changes are ignored for non-chat searches.

    Net result: no refetch, stale snapshot, count doesn't update — exactly the reported symptom. This is the same "field changed without adding/removing a transaction" regression class the PR set out to fix; the new guard just doesn't cover a transaction moving into a displayed report group.

    Timing check: merged 2026-08-14, in the 9.4.54 staging release. Matches the staging-yes / production-no signal.

    Roll-forward alternative (if keeping the optimization): broaden the non-chat trigger so it also refetches when a transaction's previous or new reportID matches a report group currently shown in the results (match on report-group membership, not just transaction-ID presence). changeTransactionsReport already writes transactions_<id>.reportID optimistically, so the change is detectable. Regression-test against the four flows #98558 already fixed (move-to-report, remove-from-report, bulk submit, edit amount) plus this add-existing-expense flow.


    Next Steps: Reply with @MelvinBot implement this to open a draft revert PR, or @MelvinBot <feedback> to refine this analysis.

  10. IuliiaHerets commented on Aug 17, 2026

    @IuliiaHerets

    Chrome / v9.4.54-2
    Not repro

    fc285017c5a524d304194ed6dab82be4.mp4
  11. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Aug 17, 2026
  12. changed the title [-]Spend - Expenses count does not update after adding expense to report[/-] [+][Due for payment 2026-08-25] Spend - Expenses count does not update after adding expense to report[/+] on Aug 18, 2026
  13. melvin-bot commented on Aug 18, 2026

    @melvin-bot

    @QichenZhu

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.54-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-08-25. 🎊

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