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 search suggestions #1032

Merged
merged 2 commits into from
Oct 24, 2023
Merged

Fix search suggestions #1032

merged 2 commits into from
Oct 24, 2023

Conversation

antidipyramid
Copy link
Collaborator

@antidipyramid antidipyramid commented Oct 20, 2023

Overview

This PR fixes a bug where search suggestions were not loading correctly.

Connects #1030

Issue summary

When a new visitor loads the page we request a Smartlogic token for them. However, we weren't waiting for the token to be granted and stored before setting up the search bar, causing a 403 error whenever it tried to get suggestions. The token was fetched after the bar had been configured.

On subsequent page loads, the search suggestions functioned as expected since the token was already stored in the browser.

Testing Instructions

  • Either open a private window or clear your browser's cookies/cache (note that in some browsers, e.g. Firefox, browser data persists across open private tabs)
  • Navigate to the homepage
  • Verify that you are able to load search suggestions

@antidipyramid antidipyramid requested a review from xmedr October 20, 2023 15:02
Copy link
Collaborator

@xmedr xmedr left a comment

Choose a reason for hiding this comment

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

Nice, this works as expected and feels like a pretty elegant solution!

@hancush
Copy link
Collaborator

hancush commented Oct 24, 2023

@antidipyramid Are we waiting on anything to deploy this?

@antidipyramid
Copy link
Collaborator Author

@hancush Nope this one is good!

@antidipyramid antidipyramid merged commit 6e332f2 into main Oct 24, 2023
2 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.

3 participants