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(breadcrumb): guard against undefined facets #5482

Merged
merged 2 commits into from
Feb 20, 2023

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Feb 16, 2023

Summary

If a breadcrumb widget gets "its" hierarchical menu added dynamically, there will be a render where getFacetValues returns undefined.

I checked, and all other cases of getFacetValues guard already for its result possibly being undefined.

Also added the common test for optimistic UI for breadcrumb, as it's a related fix.

Result

No error when hierarchical menu for a breadcrumb gets added dynamically

If a breadcrumb widget gets "its" hierarchical menu added dynamically, there will be a render where getFacetValues returns `undefined`.

I checked, and all other cases of `getFacetValues` guard already for its result possibly being undefined.

Also added the common test for optimistic UI for breadcrumb, as it's a related fix.
@Haroenv Haroenv requested review from a team, dhayab and sarahdayan and removed request for a team February 16, 2023 13:25
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 16, 2023

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 f76bbd9:

Sandbox Source
InstantSearch.js Configuration
react-instantsearch-app Configuration

@Haroenv Haroenv enabled auto-merge (squash) February 20, 2023 10:14
@dhayab
Copy link
Member

dhayab commented Feb 20, 2023

@Haroenv should this guard be also applied to the hierarchical menu as well?

@Haroenv
Copy link
Contributor Author

Haroenv commented Feb 20, 2023

@Haroenv should this guard be also applied to the hierarchical menu as well?

Hierarchical menu, menu, refinement list etc. already have this guard

@Haroenv Haroenv merged commit 3159afe into master Feb 20, 2023
@Haroenv Haroenv deleted the fix/breadcrumb-facets-undefined branch February 20, 2023 11:28
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