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

feat: add lang parameter to the queriesPreview hash #1653

Merged

Conversation

lauramargar
Copy link
Contributor

@lauramargar lauramargar commented Nov 11, 2024

Pull request template

When we made the implementation of cached the queries preview, we didn't realize that a queryPreview could work with different languages, but obtain different results.

Now when we change the language and a queryPreview return results in both languages we are not making a new request of the query with the new language. That's because the query is already saved in the state.

The change that we have made in this PR is to add the lang param to the QueryPreview hash.

Motivation and context

  • Dependencies. If any, specify:
  • Open issue. If applicable, link: RST-2449

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that causes existing functionality to not work as expected)
  • Change requires a documentation update

What is the destination branch of this PR?

  • Main
  • Other. Specify:

How has this been tested?

Install this version in Bigbuy, change the language and set queriesPreview to [].
Then check that the first carousel (innovagoods) changes it results when you set a new lang.

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review on my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

@lauramargar lauramargar requested a review from a team as a code owner November 11, 2024 13:19
@annacv
Copy link
Contributor

annacv commented Nov 11, 2024

Great job!
Maybe it makes sense to add a test to prove that the same query can be requested consecutively from 2 different langs without being cancelled?

@lauramargar lauramargar merged commit b41e6c6 into main Nov 13, 2024
4 checks passed
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