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(commerce): namespace field suggestions to prevent clash with facet search #4247

Merged
merged 4 commits into from
Aug 5, 2024

Conversation

Spuffynism
Copy link
Contributor

@Spuffynism Spuffynism commented Aug 1, 2024

Since facets in a global search configuration are used to power both field suggestions and facets, it's possible that field suggestions for a field be active at the same time that a facet search for the same field is. This means that updating the text on a field suggestions controller would cause a facet's facet search values to be updated as well. This is because both the field suggestions and facet search were powered by the same state.

To prevent this issue, I namespace the facetId used for field suggestions only on the facet search reducers (the regular, and category one).

I opted for this approach instead of reversing the dependency on the facet search controller to read state from selectors since it would've lead to much more changes in the controllers.

CAPI-1201

Copy link

github-actions bot commented Aug 1, 2024

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 244.1 244.1 0
commerce 341 341.1 0.1
search 413.8 414 0
insight 391.5 391.7 0
product-listing 306.2 306.4 0.1
product-recommendation 210.4 210.4 0
recommendation 257.2 257.2 0
ssr 404.4 404.6 0
ssr-commerce 337.9 338 0.1

SSR Progress

Use case SSR (#) CSR (#) Progress (%)
search 39 44 89
recommendation 0 4 0
product-recommendation 0 10 0
product-listing 0 13 0
case-assist 0 6 0
insight 0 27 0
commerce 0 15 0
Detailed logs search : buildInteractiveResult
search : buildInteractiveInstantResult
search : buildInteractiveRecentResult
search : buildInteractiveCitation
search : buildGeneratedAnswer
recommendation : missing SSR support
product-recommendation : missing SSR support
product-listing : missing SSR support
case-assist : missing SSR support
insight : missing SSR support
commerce : missing SSR support

@Spuffynism Spuffynism marked this pull request as ready for review August 1, 2024 20:46
@Spuffynism Spuffynism requested review from a team as code owners August 1, 2024 20:46
Copy link
Contributor

@fbeaudoincoveo fbeaudoincoveo left a comment

Choose a reason for hiding this comment

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

Quite unrelated, but now that I think of it, do you also plan to fix the issue where the facetSearch controllers for fieldSuggestion controllers are initialized with no initial query, even though the query might be non-empty at the moment when they're initialized?

This is a minor issue, but still a potential bug.

@Spuffynism Spuffynism added this pull request to the merge queue Aug 5, 2024
Merged via the queue into master with commit a26184e Aug 5, 2024
114 of 116 checks passed
@Spuffynism Spuffynism deleted the fix-capi-1201-namespace-field-suggestions branch August 5, 2024 14:42
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