Skip to content

Stop expense-driven Home Insights chart refreshes - #106796

Merged
luacmartins merged 1 commit into
mainfrom
claude-stopHomeInsightsLiveUpdates
Nov 13, 2026
Merged

luacmartins merged 1 commit into
mainfrom
claude-stopHomeInsightsLiveUpdates

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Remove the expense-signature subscription and expense counter from the Home Insights chart refresh key so incoming expense updates no longer rerun its Search or queue a refresh behind an RHP. Preserve initial load, actual Home revisits, chart selection, reconnect, configuration resolution, workspace membership, and app-foreground refresh behavior. Other Home cards and full Insights are unchanged.

Add unit coverage for repeated expense-signature changes, expense changes behind an RHP, Home return, chart switching, equivalent configuration identity, reconnect, and configuration resolution.

AI Tests

  • Passed: 177 tests across five focused suites (Home Insights refresh, shared tab refresh, Recently Added, Your Spend, and ToDo counts).
  • Passed: full lint, changed-file lint, typecheck, spelling, direct React Compiler validation of the changed hook, Storybook smoke test, and coding-standards review (no violations).
  • Full Jest run exceeded the 10-minute limit before completion; no test failures were reported before timeout.
  • Formatting validation unavailable: this checkout has no prettier npm script; alternate formatter invocations were denied by execution permissions.
  • Compiler check-changed failed because the environment supplied an empty base ref (origin/); direct hook compilation passed instead.
  • Web runtime verification remains blocked: the ready browser session displayed a blank page, returned zero UI nodes, and had no recent network entries. No chart behavior was verified in-browser.

Fixed Issues

$ #106791
PROPOSAL: #106791 (comment)

Tests

Manual test plan (not a claim that these steps have passed):

  1. Sign in to the development build with an account that has access to a workspace with enough expenses to populate Home Insights. Open Home and let the selected chart finish loading.
  2. Monitor network requests for the selected chart's Search (for example, searchKey=spendOverTime). Identify chart requests by their payload rather than counting every Home Search request.
  3. 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, then edit an amount or date and delete an expense included in the selected chart. Keep the first session on Home without changing charts, foregrounding the app, or changing workspace membership.
  4. Verify that these incoming additions, edits, and deletions do not trigger another selected-chart search and that the chart retains its loaded snapshot. Verify that the other Home cards, including ToDos when applicable, still update as before.
  5. Navigate to another tab, then return to Home. Verify that the selected chart requests fresh data and reflects the relevant expense changes.
  6. Change the selected chart. Verify that a search for the newly selected chart runs and its data loads.
  7. With Home open, disconnect and reconnect the network. Verify that the selected chart requests fresh data after reconnecting.
  8. Open a right-hand panel (RHP) over Home and close it without changing anything. Verify that closing it does not trigger another selected-chart search.
  9. Open an RHP over Home again. From the other session, add, edit, and delete relevant expenses, wait for the updates to arrive, then close the RHP. Verify that no expense-driven chart search runs while the panel is open or merely because it closes.
  10. Verify that no errors appear in the JS console during these steps.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

QA plan (pending execution on a staging build containing this change):

  1. Open Home with an account that has enough workspace expenses to populate Insights, and let the selected chart finish loading.
  2. Monitor network requests for the selected chart's Search (for example, searchKey=spendOverTime), distinguishing them from searches for other Home cards.
  3. From another session, create multiple expenses in a workspace accessible to the first account, edit a relevant expense's amount or date, and delete a relevant expense. Allow each update to reach the first account while it remains on Home without changing charts, foregrounding the app, or changing workspace membership.
  4. Verify that no additional selected-chart searches run solely because of those updates and that the chart retains its loaded snapshot. Verify that other Home cards, including ToDos when applicable, retain their existing live-update behavior.
  5. Leave Home for another tab and return. Verify that the selected chart fetches fresh data and reflects the relevant expense changes.
  6. Select a different chart and verify that its search runs and its data loads.
  7. Disconnect and reconnect the network while on Home. Verify that the selected chart fetches fresh data after reconnecting.
  8. Open and close an RHP over Home without making changes. Verify that closing it does not trigger a chart search.
  9. Repeat with expense additions, edits, and deletions arriving from the other session while the RHP is open. Verify that those updates do not trigger chart searches or queue a chart refresh for when the RHP closes.
  10. Verify that no errors appear in the JS console during these steps.
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native

Not yet tested — needs manual QA.

Android: mWeb Chrome

Not yet tested — needs manual QA.

iOS: Native

Not yet tested — needs manual QA.

iOS: mWeb Safari

Not yet tested — needs manual QA.

MacOS: Chrome / Safari

Not yet tested — needs manual QA.

Co-authored-by: Vit Horacek <mountiny@users.noreply.github.com>
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Nov 12, 2026
@MelvinBot
MelvinBot requested a review from a team November 12, 2026 22:54
@mountiny

Copy link
Copy Markdown
Contributor

@codex review

@mountiny
mountiny marked this pull request as ready for review November 12, 2026 22:57
@mountiny
mountiny requested a review from a team as a code owner November 12, 2026 22:57
@melvin-bot
melvin-bot Bot requested review from TaduJR and removed request for a team November 12, 2026 22:57
@melvin-bot

melvin-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown

@TaduJR Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T23:00:17.359081Z 6ba00c1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@melvin-bot
melvin-bot Bot requested review from joekaufmanexpensify and removed request for a team November 12, 2026 22:57
@mountiny
mountiny requested review from a team and huult and removed request for TaduJR November 12, 2026 22:57
@melvin-bot
melvin-bot Bot requested review from trjExpensify and removed request for a team November 12, 2026 22:57
@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Something went wrong. This may be a transient issue. Try again. If it persists, check status.openai.com.

Run details

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 6ba00c1b77

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@huult

huult commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Screen.Recording.2026-11-13.at.08.51.58.mov

@MelvinBot

MelvinBot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ⚠️ partial

Recovered authentication on standalone Android NewDot and reached Home, but the Insights chart remained unavailable. Request monitoring was inconclusive, so chart behavior could not be verified.

Authenticated Home showing loading placeholders rather than a loaded Insights chart

Step Status
Open Home and let Insights finish loadingHome was selected, but loading placeholders remained and no chart controls were available.
Authenticated Home showing loading placeholders rather than a loaded Insights chart
⚠️
Monitor selected chart Search requestsMonitoring returned no identifiable chart requests. This does not prove requests were absent.
⚠️
Create multiple expenses from another sessionBlocked: a second concurrent session is unsupported.
⚠️
Expense additions, edits, and deletions do not refresh the chartUnverified: incoming-update fixture and chart request observations were unavailable.
⚠️
Home return, chart selection, and reconnect refresh chart dataBlocked by the unavailable initial chart.
⚠️
Other Home cards retain live updatesTo-dos was present, but live updates were not exercised.
⚠️
Closing an RHP does not unnecessarily refresh the chartBlocked by the unavailable chart; the incoming-update variant also requires another session.
⚠️
No JS console errorsConsole inspection was unavailable; a clean console could not be confirmed.
⚠️

view run · view recording

@MelvinBot

MelvinBot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ⚠️ partial

Verified supported independent checks on dev NewDot web after creating a workspace; Insights reached an insufficient-data state. Incoming-update checks, chart-specific request attribution, reconnect testing, and JS-console verification remain blocked.

Location-access dialog blocking the expense RHP closure check

Step Status
Open Home and let Insights finish loadingLoading completed with “Chart unavailable — We don’t have enough data to populate this chart yet.” Populated chart rendering remains unverified.
Home Insights insufficient-data state with chart selector open
⚠️
Monitor selected chart Search requestsSuccessful Search requests were captured, but request bodies were unavailable, preventing selected-chart attribution.
⚠️
Create multiple accessible expenses from another sessionBlocked: only one pinned session is supported. No second session was created.
⚠️
Expense additions, edits, and deletions do not refresh the chartUnverified: the background expense-update fixture was unavailable. No request-suppression verdict is claimed.
⚠️
Home return, chart selection, and reconnect fetch fresh dataSwitching to Top merchants produced one successful Search request; returning from Inbox to Home produced four. Chart-specific freshness could not be confirmed, and reconnect testing was unavailable.
⚠️
Other Home cards retain live updatesWorkspace setup appeared as Done, but live ToDos updates during background expense changes were not verified.
Home cards after workspace setup
⚠️
Closing an RHP does not unnecessarily refresh the chartA location-access dialog blocked the expense RHP closure check. The incoming-update variant also requires another session.
Location-access dialog blocking the expense RHP closure check
⚠️
No JS console errorsConsole inspection was unavailable through the supported testing interface; a clean console could not be confirmed.
⚠️

view run · no recording available

@huult

huult commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot Could you add the test steps and QA steps, following the format used in the Steps to Reproduce section of ticket #106791?

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Updated the PR’s Tests and QA Steps with numbered instructions matching the ticket’s format, covering expense updates, allowed refresh triggers, other Home cards, RHP closure, and console errors.

Both sections are clearly labeled as test plans—not completed testing.


view run

@mountiny

Copy link
Copy Markdown
Contributor

@huult how is this looking?

@huult

huult commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@mountiny I'm nearly done

@huult huult left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@melvin-bot
melvin-bot Bot requested a review from mountiny November 13, 2026 01:58

@trjExpensify trjExpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huult

This comment has been minimized.

@luacmartins
luacmartins merged commit 32d3fef into main Nov 13, 2026
57 of 59 checks passed
@luacmartins
luacmartins deleted the claude-stopHomeInsightsLiveUpdates branch November 13, 2026 02:17
@github-actions

Copy link
Copy Markdown
Contributor

🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/luacmartins in version: 9.5.38-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 cancelled 🔪
🍎 iOS 🍎 cancelled 🔪

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site update needed — this PR only changes chart refresh behavior, adds no new workflow, and makes no existing article sentence incorrect.


view run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants