Skip to content

Conversation

@abeglova
Copy link
Contributor

@abeglova abeglova commented Sep 16, 2024

What are the relevant tickets?

closes https://github.com/mitodl/hq/issues/5454

Description (What does it do?)

This pr fixes two related bugs:

  1. The search page refreshes if you go to a different tab or just leave the page open for too long
  2. If there is no search term, the search results don't have a determined order after the featured resources on the first few pages so that if you refresh https://rc.learn.mit.edu/search/?page=10 a few times, for example the results change. The results are the same from each node but not the same between nodes so if the query is picked up by a different node, the results change. This means that if a user is paging through resources there will be some duplicates and some resources that aren't shown.

For a user this combination of bugs is annoying because if the user clicks through to a learning resource then comes back, they lose their search results

How can this be tested?

  • Verify that both the home page and the search page still load everything

  • To test 1) Go to http://open.odl.local:8062/search/?page=10. Go to a different tab and stay there for a minute. Come back to your original tab. The page should not refresh

  • Unfortunately 2) can't be tested locally, since locally there is only one opensearch node locally. It can be tested on rc

@abeglova abeglova marked this pull request as ready for review September 16, 2024 20:32
@abeglova abeglova added the Needs Review An open Pull Request that is ready for review label Sep 16, 2024
@abeglova abeglova changed the title Ab/tab refresh Add deterministic search order and prevent unneeded refreshes Sep 16, 2024
@abeglova abeglova changed the title Add deterministic search order and prevent unneeded refreshes Prevent unnecessary refreshes and add sort order Sep 16, 2024
Copy link
Contributor

@ChristopherChudzicki ChristopherChudzicki left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me.

@abeglova abeglova merged commit 7c0fc87 into main Sep 17, 2024
@rhysyngsun rhysyngsun deleted the ab/tab-refresh branch February 7, 2025 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants