plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
446 stars 606 forks source link

[Search Block]: Live search triggers several requests to `@querystringsearch` #5219

Open sneridagh opened 11 months ago

sneridagh commented 11 months ago

Describe the bug The search block triggers several requests on actions

eg. using the searchbox: It now triggers three times, one of them being "wrong" (not matching the current query elements), so there's one moment that the result is incorrect. This could affect acceptance tests too.

To Reproduce Steps to reproduce the behavior:

  1. Add a search block with a custom query
  2. Search for a term in the searchbox
  3. Monitor the network tab, it triggers several requests to @querystringsearch

Expected behavior We should only trigger one request per action/state change.

Also, when typing a debounce should be added too.

JASIM0021 commented 11 months ago

can you describe it with more details including file or page url if posible

ionlizarazu commented 11 months ago

I found to a way to test the amount of the querystring-search queries with cypress. We can work on it in this branch https://github.com/plone/volto/tree/ionlizarazu-search-block-querystring-search @sneridagh