Skip to content

Clear buffered results before a new Quick Search - #347031

Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
sameerihs:clear-buffered-quick-search-results
Nov 13, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
sameerihs:clear-buffered-quick-search-results

Conversation

@sameerihs

Copy link
Copy Markdown
Contributor

Fixes #195165

Quick Search starts a new search while the previous one may still have buffered progress results. Those old results can be flushed into the new query, leaving entries such as old.txt: old after the input changes to new.

Clear the previous result queue after cancelling the old search and before starting the new one. Regressions cover new queries with and without synchronous matches and the actual Quick Search provider through provide() and the picker's input-change event. They use no post-cancellation provider callbacks.

All three regressions fail on unchanged main and exact 1.145.2 model source, then pass after the fix. The 52 neighbouring checks, targeted ESLint and client typecheck pass. Stable validation is source-based; the ordinary Search view's serial query path is not claimed as another reproduced trigger.

Copilot AI balanced review requested due to automatic review settings November 9, 2026 16:20

Copilot AI 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.

🟢 Approval recommended

No active review issues were identified for the change preventing stale Quick Search results from appearing after input changes.

No open issues 🎉

What changed in this PR

Fixes #195165 by preventing buffered results from a previous Quick Search query from appearing after the input changes.

Changes:

  • Clears the result queue after cancelling the previous search and before starting the next.
  • Adds model regressions for new queries with and without synchronous matches.
  • Adds a Quick Search provider regression covering picker input changes.
File Description
src/​vs/​workbench/​contrib/​search/​test/​browser/​textSearchQuickAccess.test.ts Tests that changing picker input excludes buffered matches from the previous query.
src/​vs/​workbench/​contrib/​search/​test/​browser/​searchModel.test.ts Tests queue clearing with and without synchronous results.
src/​vs/​workbench/​contrib/​search/​browser/​searchTreeModel/​searchModel.ts Clears buffered results before initializing a new search.

Review effort: Balanced

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Sameer (@sameerihs) Thank you!

Copilot AI 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.

🟡 Changes recommended

The cancellation tests can falsely pass on unrelated errors because the browser and Electron assertion shim ignores the predicate passed to assert.rejects.

1 open issue

Review effort: Max

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 394efff into microsoft:main Nov 13, 2026
52 of 53 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.147.0 milestone Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants