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(cache): support multi-index and multiple queries per index #6275

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

aymeric-giraudet
Copy link
Member

@aymeric-giraudet aymeric-giraudet commented Jul 9, 2024

Summary

FX-2938

Fixes part of #6258 and #6259

Result

  • A single index may cause up to 3 requests at once, if it has facets applied or hierarchical facets, so request params should be an array.
  • Shape of a cached request is { method: 'search', args: [Array<QueryParams>] }, not { method: 'search', args: Array<Array<QueryParams>> } as it takes a single argument which is an array of params.

@aymeric-giraudet aymeric-giraudet requested review from a team, dhayab and Haroenv and removed request for a team July 9, 2024 16:06
Copy link

codesandbox-ci bot commented Jul 9, 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 ca700da:

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
Copy link
Contributor

Haroenv commented Jul 10, 2024

Which parts of #6258 and #6259 aren't solved in this PR?

@aymeric-giraudet
Copy link
Member Author

aymeric-giraudet commented Jul 10, 2024

@Haroenv this one :

Now click on Women, there is a data request(which handles SSR via the loader using getServerState) and there is also an unnecessary client side query.

We would need to react to initialResults changes and totally opt-out of client-side requesting, or just have Remix users not call the loader if possible as it may add unnecessary overhead

And the one at the end of #6259 is unrelated too. I'll ask them to split once this is done

@Haroenv
Copy link
Contributor

Haroenv commented Jul 10, 2024

In that case I think the issue identified in #6258 can be marked as done, and the part where the remix integration docs is wrong can be a separate ticket :)

Copy link
Member

@dhayab dhayab left a comment

Choose a reason for hiding this comment

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

👏

@aymeric-giraudet aymeric-giraudet merged commit 60c3f20 into master Jul 11, 2024
12 checks passed
@aymeric-giraudet aymeric-giraudet deleted the fix/hydrate-cache-multi-index-and-queries branch July 11, 2024 08:26
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.

3 participants