split event with > 20 objectIDs #4963
Unanswered
eunjae-lee
asked this question in
Ideas
Replies: 1 comment 2 replies
-
interesting, but won't that break people on older versions of search-insights? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Since this PR #4841, an event with more than 20 objectIDs is split into multiple requests. Now that multiple events in a single request is supported in search-insights (algolia/search-insights.js#335), we can update InstantSearch.js as well to send a single request instead of many.
I propose to revert some of the part of the previous work, which is splitting payload and call
instantSearchInstance.sendEventToInsights()
multiple times. For those usingonEvent
hook to get the payload, this can be confusing because it's supposed to be a single callback for them. I think we can split the job withininstantSearchInstance.sendEventToInsigths()
method.This line
https://github.com/algolia/instantsearch.js/blob/master/src/middlewares/createInsightsMiddleware.ts#L155:L155
can become something like this:
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions