nextstrain / nextstrain.org

The Nextstrain website
https://nextstrain.org
GNU Affero General Public License v3.0
87 stars 49 forks source link

Error when navigating between datasets using dropdown menu on community build #240

Open kistlerk opened 3 years ago

kistlerk commented 3 years ago

Current Behavior
Unable to navigate between viruses on Nextstrain Community using the dropdown menu

Expected behavior
Should be able to select a different virus from the drop-down menu to load the tree for that virus. Navigating between genes works as expected.

How to reproduce
Steps to reproduce the current behavior:

  1. go to https://nextstrain.org/community/blab/seasonal-cov-adaptive-evolution/229e/rdrp
  2. use drop down menu to select "oc43" instead of "229e"
  3. Error is: "There seems to have been an error accessing that dataset. Details: Couldn't load JSONs for /community/blab/seasonal-cov-adaptive-evolution/oc43. Please email us if you think this is a bug."

Your environment: if browsing Nextstrain online

jameshadfield commented 3 years ago

Thanks Katie 👍

Notes for bugfix: this happens because when using the sidebar to change dataset, auspice forms the desired dataset using fields up-to the level of the changed dropdown box. In this case, the client makes a request for the /community/blab/sesonal-cov-adaptive-evolution/oc43 dataset, which doesn't exist and so we get the 404. The reason this doesn't happen elsewhere, e.g. in the core builds, is that the server will respond with a 304 redirect to point to the "best" dataset given the (non-existing) requested dataset. E.g. a request for /flu gets redirected to /flu/seasonal/h3n2/ha/2y. To fix this bug the server logic should be changed in this case to return a redirect from /community/blab/sesonal-cov-adaptive-evolution/oc43 to /community/blab/sesonal-cov-adaptive-evolution/oc43/<X> where <X> is {rdrp,s1,s2,spike}; how exactly <X> is to be chosen here is up for grabs. Note that the request does not contain information about the previous dataset viewed (/229e/rdrp in this example); to do so would require a change in the request sent from auspice.