Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debounce webui search #924

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Conversation

gbodeen
Copy link
Contributor

@gbodeen gbodeen commented May 31, 2024

The search input field on the open-vsx.org is not debounced. So, for example, if I rapidly type "123456" into the search field and add a debug log for the requests sent by the page, I see a separate query sent for each character:

image

There is, however, code present for debouncing the sending of new searches and aborting old requests. It's just not run at the correct time. I believe the empty useEffect dependency list (removed in this MR) was an accidental mistake. Without that empty list, the debounce behavior appears correct; the useEffect callback cancels all but the last search within the debounce period. Only the final query is sent to the server.

@vince-fugnitto
Copy link
Member

I believe the improvement fixes #925 👍

@amvanbaren
Copy link
Contributor

Thanks @gbodeen! Works as expected.

@amvanbaren amvanbaren merged commit 8c132bf into eclipse:master Jun 4, 2024
2 checks passed
@gbodeen
Copy link
Contributor Author

gbodeen commented Jun 6, 2024

@amvanbaren
Unfortunately, we've found an error with this in a downstream project. It can cause extensions not to appear on a fresh load of the webui homepage. I'll suggest a fix in a moment.

@amvanbaren
Copy link
Contributor

@gbodeen I noticed the same upon closer inspection. #932 fixes it.

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.

3 participants