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

fix(insights): fix the regression that it didn't send events with instantsearch.insights() #4519

Merged
merged 2 commits into from Sep 22, 2020

Conversation

eunjae-lee
Copy link
Contributor

@eunjae-lee eunjae-lee commented Sep 21, 2020

Summary

This PR fixes the regression introduced since 4.8.0 where InstantSearch didn't send Insights events implemented with instantsearch.insights() in hits or infiniteHits widgets.

Result

It sends events now.

Test
If you run this example ->, it will correctly send events when you click buttons. However if you change the version of InstantSearch to 4.8.0, it won't any more.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 21, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1812da7:

Sandbox Source
InstantSearch.js Configuration
throbbing-sky-dsldc PR

} else {
}

{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prop.sendEvent exists, so it always followed the first if branch. We should run them both.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we should run them both, you should probably remove the curly brace here and on line 72

@eunjae-lee eunjae-lee marked this pull request as ready for review September 21, 2020 15:17
@eunjae-lee eunjae-lee requested a review from a team September 21, 2020 15:17
@ghost ghost requested review from francoischalifour and yannickcr and removed request for a team September 21, 2020 15:17
} else {
}

{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we should run them both, you should probably remove the curly brace here and on line 72

@eunjae-lee eunjae-lee merged commit 10e38df into master Sep 22, 2020
Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we cover this regression with a test?

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.

None yet

4 participants