-
Notifications
You must be signed in to change notification settings - Fork 528
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(rendering): ensure resilience against "null" results #6442
Conversation
In some cases `results` in `render` can be null: - no index name passed - stalled render In the vast majority of cases we already handled `results` being `null` or `undefined` just in case, but now i've changed the type to ensure we always catch this problem This issue doesn't have a reproduction, but i believe it now guards for all possible cases of "no results", so: fixes #6441 [CR-7353]
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Since this might result in type errors, would this count as a breaking change?
don't think so as the type already was able to be null, it was just typed wrong @shaejaz |
This will be merged and released after code freeze is over; if you bump into the "results is null" error, you can ignore it as the page still behaves correctly, when results is null no events can have happened yet |
Summary
In some cases
results
inrender
can be null:instantsearch/packages/algoliasearch-helper/src/algoliasearch.helper.js
Lines 1503 to 1510 in a896774
In the vast majority of cases we already handled
results
beingnull
orundefined
just in case, but now i've changed the type to ensure we always catch this problemResult
null is handled in all cases for results
This issue doesn't have a reproduction, but i believe it now guards for all possible cases of "no results", so:
fixes #6441
CR-7353