Skip to content

fix: undefined query should work like null query VSCODE-774#1307

Merged
lerouxb merged 3 commits intomainfrom
fix-isBasicView
Apr 14, 2026
Merged

fix: undefined query should work like null query VSCODE-774#1307
lerouxb merged 3 commits intomainfrom
fix-isBasicView

Conversation

@lerouxb
Copy link
Copy Markdown
Member

@lerouxb lerouxb commented Apr 14, 2026

@lerouxb lerouxb requested a review from a team as a code owner April 14, 2026 16:12
Copilot AI review requested due to automatic review settings April 14, 2026 16:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses VSCODE-774 by treating an undefined query value the same as a null query value when determining whether the document browsing view should behave as a “basic query” view.

Changes:

  • Updated isBasicQuery to return true when state.query is undefined as well as null.
  • Added a unit test covering the query === undefined case.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/views/data-browsing-app/store/documentQuerySlice.ts Expands the “basic query” condition to include undefined query values.
src/test/suite/views/data-browsing-app/documentQuerySlice.test.tsx Adds test coverage for isBasicQuery when query is undefined.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/views/data-browsing-app/store/documentQuerySlice.ts
Copy link
Copy Markdown
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

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

I might rename isBasicQuery to something like isEmptyFindResult or something, that's a bit of a nit and unrelated, fine as is. The copilot comment is something we likely want to fix, the type gaurd isn't correct anymore.

@lerouxb
Copy link
Copy Markdown
Member Author

lerouxb commented Apr 14, 2026

It isn't empty finds, though. That's still a cursor. By basic I mean is not a cursor. Could have checked the inverse too, though.

Comment thread src/views/data-browsing-app/store/documentQuerySlice.ts Outdated
) {
const queryString = window.MDB_DATA_BROWSING_OPTIONS.query;
return deserializeBSON(queryString) as ServiceProviderQuery;
return (deserializeBSON(queryString) as ServiceProviderQuery) || null;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The real bug is that some things deserialize to undefined and it should be either a ServiceProviderQuery or null

@lerouxb lerouxb merged commit 073cfd1 into main Apr 14, 2026
18 of 19 checks passed
@lerouxb lerouxb deleted the fix-isBasicView branch April 14, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants