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

Too many requests sent #149

Open
pixelkoduje opened this issue Feb 16, 2023 · 5 comments
Open

Too many requests sent #149

pixelkoduje opened this issue Feb 16, 2023 · 5 comments

Comments

@pixelkoduje
Copy link

I am using next.js algolia boilerplate - You can see that after refreshing the page and clicking on the select option, it loads 2 requests. Using typesense and an adapter, it does 3 - causing the app to flicker, and swaps the results 2 times.
https://codesandbox.io/s/github/algolia/instantsearch/tree/master/examples/react-hooks/next

image

image

Are you able to find out why and how to prevent this from happening? Thank you very much my friend.

@pixelkoduje
Copy link
Author

image
Here is the result from the example in the link above. 1 query instead of 3 - including 2 the same, one completely unnecessary. What is flickering. ://

@jasonbosco
Copy link
Member

Could it be possible that the typesenseInstantsearchAdapter object is being instantiated multiple times somehow?

That could cause the InstantSearch component to re-render, since it's searchClient prop is changing...

@pixelkoduje
Copy link
Author

Well, it comes from the backend - even removing this element and leaving the basic configuration - it doesn't matter. It still sends too many queries and flashes.

@pixelkoduje
Copy link
Author

Has anything changed on this topic?

@jasonbosco
Copy link
Member

jasonbosco commented Mar 6, 2023

Hard to tell where the issue is. If you're able to narrow it down to something in the adapter let me know.

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

No branches or pull requests

2 participants