Skip to content

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Apr 2, 2025

Summary

Refactors InitialisePromise to use the waitForResults of InstantSearch.js, which correctly rethrows errors if they happen in search, composition or recommend.

Be careful when refactoring to ensure I didn't misunderstand the intent of the original code, as I don't remember why we didn't use InstantSearch' waitForResults in the first place. There may be a subtle difference between the functions I didn't catch.

Result

fixes #6525

@Haroenv Haroenv requested review from dhayab and shaejaz April 2, 2025 08:17
Copy link

codesandbox-ci bot commented Apr 2, 2025

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 1d82767:

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

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.

Great refactoring. The only difference I see is that we now explicitly search again from within waitForResults() whereas before the search would have happened earlier. Don't think it makes a difference in the end.

@Haroenv
Copy link
Contributor Author

Haroenv commented Apr 8, 2025

I want to evaluate the feedback in #6525 a little more, it seems that if the search throws there's still some sort of (in)finite nesting of the error going on, although search seems to be called only once

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.

Infinite Page Loading Next.js when no connection to search server

3 participants