Ais-configure cause multiple hit to algolia api, doubling the facet filter

vue
vue-instantsearch

#1

Hello, I found this issue in my app, and is driving me crazy.

I have prepared this example, where I am adding a button to show / hide the menu.

Edit Check extra request

This is a simplified example, but I found in the real application, that after several clicks on that button, Chrome crash.

image

And it is because every time I click on the button, multiple requests are made to the algolia api.

image

And in each of them, the ‘facets’ parameter is duplicated

image
image

After dismantling the entire application, and reassembling it component by component, I discovered that this is caused by the ais-configure

Without ais-configure this doesn’t happen, and as you can see in the example, is a simple:

<ais-configure :hits-per-page.camel="4"></ais-configure>

Can someone help me solve this, please?

Thank you


#2

Someone, please? This crash my entire app.


Vue instant search hits algolia several times
#3

Hi, I never saw this issue you posted, sorry! My hunch is that you are using inline props which are objects or arrays. This basically causes Vue to always recompute those props and we have to do a new request every time.

You can fix that by moving those values to data items

Hope that helps!


#4

I solve this problem using this solution: https://github.com/algolia/vue-instantsearch/issues/663#issuecomment-489695804

Thanks !!