Skip to content

Fix: Fixed issue where search continued running after navigating away or closing a tab#18646

Open
workbysaran wants to merge 1 commit into
files-community:mainfrom
workbysaran:sg/fix-search-continues-after-exit
Open

Fix: Fixed issue where search continued running after navigating away or closing a tab#18646
workbysaran wants to merge 1 commit into
files-community:mainfrom
workbysaran:sg/fix-search-continues-after-exit

Conversation

@workbysaran

Copy link
Copy Markdown
Contributor

Resolved / Related Issues
Fixed an issue where search queries kept running in the background even after the user cleared the search, navigated to a different folder, or closed the tab, causing sustained CPU usage.

Closes #18393

Steps used to test these changes

  1. Open Files and navigate to a large drive
  2. Open the search bar and type a query slowly to confirm suggestion searches cancel per keystroke and only fire after a ~200ms pause
  3. Type a full query and press Enter and confirm search results load correctly
  4. While results are loading, navigate to a different folder and confirm the search stops promptly

Note: A brief CPU in Files.exe after cancellation is expected due to Windows Search runs as an in-process COM server and its native thread pool work drains briefly after the .NET task unblocks. Please find the profiler screenshot attached
image

@yair100 yair100 requested a review from Josh65-2201 June 25, 2026 19:25
@yair100 yair100 added the ready to merge Pull requests that are approved and ready to merge label Jun 25, 2026
@Josh65-2201

Josh65-2201 commented Jun 25, 2026

Copy link
Copy Markdown
Member

I'm not certain the search is stopping, Files shows that it's not loading anything, but CPU usage goes from 0.1% when idle to around 10% start of search and stays there for about 10 seconds before decreasing only a lit bit around 5-8% when backing out to the home page or empty folder. Although this is much less than 4.1.5 staying around 25-30% after backing out

Search results are shown same as 4.1.5

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

Labels

ready to merge Pull requests that are approved and ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Search functions continue querying even after exiting search or closing tab.

3 participants