You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-08-25] Spend - Expenses count does not update after adding expense to report #98698
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:
Go to staging.new.expensify.com
Create an empty report in workspace chat.
Create an expense in self DM.
Go to Spend > Reports.
Select the report via checkbox.
Open the report.
Click Add expense > Add existing expense.
Select self DM expense > Add to report.
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.
👋 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:
Identify the pull request that introduced this issue and revert it.
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.
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
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]
Activity
applause-bot commentedon Aug 14, 2026
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
melvin-bot commentedon Aug 14, 2026
@mountiny recently merged #98558, but they are OOO right now, so I'll auto-assign someone else.
github-actions commentedon Aug 14, 2026
👋 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:
melvin-bot commentedon Aug 14, 2026
Triggered auto assignment to @youssef-lr (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Aug 14, 2026
@mountiny @QichenZhu you have been assigned to this deploy blocker because you reviewed the offending PR: #98558
melvin-bot commentedon Aug 14, 2026
@BartekObudzinski you have been assigned to this deploy blocker because you authored the offending PR: #98558
melvin-bot commentedon Aug 14, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Aug 14, 2026
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,
useSearchHighlightAndScrollrefetched 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 nowisChat ? 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:
hasTransactionsIDsChange= false.searchResultIDs→hasChangedResultTransaction= false.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
reportIDmatches a report group currently shown in the results (match on report-group membership, not just transaction-ID presence).changeTransactionsReportalready writestransactions_<id>.reportIDoptimistically, 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 thisto open a draft revert PR, or@MelvinBot <feedback>to refine this analysis.IuliiaHerets commentedon Aug 17, 2026
Chrome / v9.4.54-2
Not repro
fc285017c5a524d304194ed6dab82be4.mp4
[-]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[/+]melvin-bot commentedon Aug 18, 2026
@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]