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): fix field suggestions state update #4245

Merged
merged 5 commits into from
Aug 1, 2024

Conversation

Spuffynism
Copy link
Contributor

@Spuffynism Spuffynism commented Aug 1, 2024

Field suggestion values weren't updating when the query changed. To fix this, we fetch the facet search state using a selector, just like we do for facets (thanks @fbeaudoincoveo!).

I've also fixed a few other things:

  • Load the proper reducers in field suggestions controllers
  • Add the reducer to the commerce engine
  • Type the reducer loaders
  • Replace the Subscribable type to Controller on field suggestions controllers
  • Adjusted the field suggestions integration test to rely on controllers instead of engine state updates. This was actually a clue that the current behavior was broken, as it was not possible to await state changes on the field suggestions 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 340.6 341 0.1
search 413.8 413.8 0
insight 391.5 391.5 0
product-listing 306.2 306.2 0
product-recommendation 210.4 210.4 0
recommendation 257.2 257.2 0
ssr 404.4 404.4 0
ssr-commerce 337.7 337.9 0

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 added this pull request to the merge queue Aug 1, 2024
@Spuffynism Spuffynism removed this pull request from the merge queue due to a manual request Aug 1, 2024
@Spuffynism Spuffynism added this pull request to the merge queue Aug 1, 2024
Merged via the queue into master with commit e8ebb09 Aug 1, 2024
112 of 116 checks passed
@Spuffynism Spuffynism deleted the fix-capi-1201-fix-field-suggestions branch August 1, 2024 20:10
fpbrault pushed a commit that referenced this pull request Aug 5, 2024
Field suggestion values weren't updating when the query changed. To fix
this, we fetch the facet search state using a selector, just like we do
for facets (thanks @fbeaudoincoveo!).

I've also fixed a few other things:
- Load the proper reducers in field suggestions controllers
- Add the reducer to the commerce engine
- Type the reducer loaders
- Replace the `Subscribable` type to `Controller` on field suggestions
controllers
- Adjusted the field suggestions integration test to rely on controllers
instead of engine state updates. This was actually a clue that the
current behavior was broken, as it was not possible to await state
changes on the field suggestions controllers 😅

[CAPI-1201]

[CAPI-1201]:
https://coveord.atlassian.net/browse/CAPI-1201?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
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