Repository navigation
Open
Labels
Description
Problem
Home's Insights chart automatically reruns its Search whenever the expense-data signature changes. Leaving Home open while expenses are created or modified—including expenses shared with the signed-in user—can therefore repeatedly recompute the chart without any user interaction. This creates unnecessary search traffic, particularly for accounts with large expense histories or frequent incoming expenses.
The agreed behavior is to stop live-updating the Home chart, rather than throttle those expense-driven refreshes.
Expected behavior
- Load the selected chart when Home is first opened.
- Refresh when returning to Home, changing the selected chart, or reconnecting.
- Do not rerun the chart search solely because an expense is created, edited, deleted, or pushed to the account while Home remains open.
- Keep the existing refresh behavior of the other Home cards, including ToDos. Do not reintroduce chart refreshes merely from closing an RHP over Home.
- Scope this change to the Home Insights chart; changing the full Insights page is not part of this issue.
Steps to reproduce
- Open Home and let the Insights chart finish loading.
- Monitor network requests for the selected chart's
Search(for example,searchKey=spendOverTime). - From another session, create an expense in a workspace accessible to the first account, and allow the update to reach that account. Repeat with multiple expenses.
- Observe additional chart searches without navigating away from Home or changing the chart.
Actual: Incoming expense changes cause fresh chart searches.
Expected: The chart retains its loaded snapshot until an allowed refresh trigger occurs.
Relevant code and context
- useInsightData.ts:41–64 subscribes to the expense signature and includes it in the Home chart's refresh key.
- InsightsSectionContent.tsx:41–46 loads the currently selected chart through that hook.
- Follow-up to Refresh the Home cards when their data changes, not when an RHP closes. This intentionally changes the chart's freshness policy without reverting the other Home-card improvements.
Acceptance criteria
- Incoming expense additions, relevant edits, and deletions do not trigger chart searches while Home stays open.
- Initial load, returning to Home, changing the chart, and reconnecting still load fresh chart data.
- Other Home cards continue updating as before.
- Closing an RHP does not cause an unnecessary chart refresh.
Slack thread: https://expensify.slack.com/archives/C05CBC62HGW/p1794373512888039
Issue Owner
Current Issue Owner: @huultUpwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022121059984518209358
- Upwork Job ID: 2121059984518209358
- Last Price Increase: 2026-11-13
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsCRITICAL
Activity
mountiny commentedon Nov 12, 2026
@MelvinBot can you prepare a proposal for how to stop the live updates?
MelvinBot commentedon Nov 12, 2026
Proposal
What is the root cause of that problem?
The Home chart includes the expense-data counter in its refresh key. Expense changes therefore trigger another chart search—or queue one until an RHP closes—even when the selected chart has not changed.
Code evidence
What changes do you think we should make in order to solve the problem?
Remove the expense-signature subscription and expense counter from the Home chart’s refresh key. Remove the accompanying comment describing expense-driven refreshes.
Keep the existing tab-aware refresh hook and remaining dependencies. This preserves initial loading, returning to Home, changing charts, and reconnecting without treating RHP closure as a fresh Home visit.
Leave the shared expense signature, other Home cards—including ToDos—and the full Insights page unchanged. No changes to Search requests or chart snapshot storage are needed.
For this minimal change, retain existing workspace-membership and app-foreground refresh behavior; these are separate from expense-driven updates.
Regression coverage
Update useInsightDataRefreshTest.ts:109–170, which currently expects expense changes to refresh the chart:
This proposal is based on code inspection; no changes or tests were run.
What alternative solutions did you explore? (Optional)
Throttling would still allow unwanted live updates. Changing the shared refresh hook or expense signature would affect other Home cards. Removing only the chart’s expense dependency keeps the change narrowly scoped.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/106791)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
mountiny commentedon Nov 12, 2026
@MelvinBot implement this with unit test coverage
MelvinBot commentedon Nov 12, 2026
🤖 Web test steps verification results:⚠️ partial
Dev NewDot web verification was blocked: the handed-over session displayed a blank page. No runtime behavior could be verified.
Home chart refresh behavior
The page returned zero UI nodes, so initial load, expense updates, navigation, chart selection, reconnect, and RHP closure remain unverified.Chart Search requests
No recent network entries were available; request counts could not be assessed.Implemented: Stop expense-driven Home Insights chart refreshes, opened as a draft and assigned to
mountiny.Unit coverage: 177 tests passed across five focused suites, including expense-update suppression, RHP closure, and preserved refresh triggers. Lint, typecheck, spelling, direct compiler validation, and Storybook smoke testing passed.
Limitations: Full Jest timed out after 10 minutes. Formatting and compiler changed-file checks were unavailable; details are recorded in the PR.
view run · no recording available
[-]Home - Stop live-updating the Insights chart on expense changes[/-][+][$175] Home - Stop live-updating the Insights chart on expense changes[/+]melvin-bot commentedon Nov 13, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022121059984518209358