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(helper): don't send empty "tagRefinements" and "facets" parameters #6204

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented May 16, 2024

Summary

In the first request, we are sending facets: [] and tagRefinements: '' when there are no values for those queries, this isn't needed, and removed in this pull request.

This came from an assumption that we could skip queries that have no refinements, but that's not true if you're for example only displaying hits

Result

Slightly more minimal request sent, consistent with the other parameters

Copy link

codesandbox-ci bot commented May 16, 2024

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 131641b:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration

@Haroenv Haroenv force-pushed the feat/map-recommend-results branch from b7755fa to 828d0cb Compare May 21, 2024 08:22
@dhayab dhayab force-pushed the feat/map-recommend-results branch from 828d0cb to b9d90b5 Compare May 21, 2024 08:44
Base automatically changed from feat/map-recommend-results to master May 21, 2024 09:29
@Haroenv Haroenv force-pushed the fix/prevent-empty-query branch 2 times, most recently from 4fe9064 to 8e62b7e Compare June 17, 2024 13:23
@Haroenv Haroenv changed the title feat(helper): don't send empty "tagRefinements" and "facets" parameters fix(helper): don't send empty "tagRefinements" and "facets" parameters Jun 17, 2024
@Haroenv Haroenv marked this pull request as ready for review June 17, 2024 14:17
@Haroenv Haroenv requested review from a team, dhayab and sarahdayan and removed request for a team June 17, 2024 14:17
var mainSubResponse = results[0];
var mainSubResponse = results[0] || {};
Copy link
Member

Choose a reason for hiding this comment

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

Why should the first response be defaulted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was needed for a previous iteration where it was possible no request was sent if there are no parameters. I reverted that, but this change stayed, as it allows the helper to be a bit more flexible and to be able to instantiate an empty SearchResults if needed

@Haroenv Haroenv merged commit fb7cc23 into master Jun 18, 2024
12 checks passed
@Haroenv Haroenv deleted the fix/prevent-empty-query branch June 18, 2024 18:20
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.

2 participants