Skip to content

fix(headless): advanced search queries parameters are not passed along #5173

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

Conversation

ThibautNazare
Copy link
Contributor

@ThibautNazare ThibautNazare commented Apr 11, 2025

SVCC-4986

Bug Description

On Wednesday, April 9th, we received a message about a customer having issues with the search page. The generated answer was returning citations that should be filtered out. They open a discuss with details.

A similar search page as the setup by the customer but using facets filtering was provided to us to reproduce the issue but we were unable to reproduce it.

After meeting with customers and observing the behaviour, we discovered that the customer was leveraging the cq advance search queries parameter to be able to filter results displayed to user, based on a value set in the user session.

Root cause search

Based on the fact that searches were not returning valid results only when an answerConfigurationId was set in the search page, we started by making sure that the answerAPI was handling correctly this advanced search query parameter. Once that was validated, we moved up the chain and made sure in headless that this parameter was transmitted to AnswerAPI in the generated request. There, we found out that not only cq parameter was not passed along to the request, but also that the aq, dq and lq advanced search query parameters were not passed along.

Solution

Even though the customer is only using cq, we decided to pass along all advanced search queries parameters to the API.

Tests & Example page updated

Unit test mock and expected payload have been updated. I also updated the example genqa page so that we have an example of how-to activate those parameters nearby.

How to test locally

  • Make sure your local setup is ready to build and run atomic
  • Pull this branch
  • Run headless unit tests with the following command npx nx run headless:test
  • Edit packages/atomic/dev/examples/genqa.html file to add a answerConfirgurationId(fc581be0-6e61-4039-ab26-a3f2f52f308f) as a property in the component at line 124
  • Run atomic dev with this command npx nx run atomic:dev
  • Open your local browser to this page
  • Open your developer tool and then Network tab
  • Look for a /generate request
  • You should find that the parameters in the request like in the following screenshot
Screenshot 2025-04-11 at 2 32 46 PM

@ThibautNazare ThibautNazare requested a review from a team as a code owner April 11, 2025 19:46
@ThibautNazare ThibautNazare changed the title Advanced search queries parameters are not passed along fix(headless): Advanced search queries parameters are not passed along Apr 11, 2025
@ThibautNazare ThibautNazare changed the title fix(headless): Advanced search queries parameters are not passed along fix(headless): advanced search queries parameters are not passed along Apr 11, 2025
@developer-experience-bot
Copy link
Contributor

developer-experience-bot bot commented Apr 11, 2025

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 248.6 248.8 0.1
commerce 361 361.1 0
search 419.6 419.8 0
insight 410.8 410.9 0
recommendation 259.5 259.6 0
ssr 413.4 413.5 0
ssr-commerce 377.5 377.6 0

@ThibautNazare ThibautNazare force-pushed the bugfix/SVCC-4986_advanced-search-queries-parameters-are-not-passed-along branch from f5d9243 to 3eb499c Compare April 11, 2025 20:59
Copy link
Collaborator

@louis-bompart louis-bompart left a comment

Choose a reason for hiding this comment

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

For the scope of this PR; the state "fishing" should be done in the selector.
At large, the whole constructAnswerQueryParams should be a compound selector (and the generateFacetParams added outside the compound selector)

@louis-bompart louis-bompart removed their assignment Apr 14, 2025
@ThibautNazare ThibautNazare force-pushed the bugfix/SVCC-4986_advanced-search-queries-parameters-are-not-passed-along branch from 3eb499c to 6696f50 Compare April 17, 2025 13:49
@ThibautNazare ThibautNazare force-pushed the bugfix/SVCC-4986_advanced-search-queries-parameters-are-not-passed-along branch from 6696f50 to f874f9d Compare April 17, 2025 16:56
@ThibautNazare ThibautNazare force-pushed the bugfix/SVCC-4986_advanced-search-queries-parameters-are-not-passed-along branch from f874f9d to b68552b Compare April 22, 2025 15:22
@ThibautNazare ThibautNazare added this pull request to the merge queue Apr 22, 2025
Merged via the queue into master with commit d373646 Apr 22, 2025
127 checks passed
@ThibautNazare ThibautNazare deleted the bugfix/SVCC-4986_advanced-search-queries-parameters-are-not-passed-along branch April 22, 2025 16:47
ThibautNazare added a commit that referenced this pull request Apr 24, 2025
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