You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's some weird behaviour with Auspice modifying page history such that the back button breaks. For example, go to https://nextstrain.org/staging, observe you get a list of staging datasets and no 404 message, click a dataset, click the back button. You end up with a 404 message and a list of "live" datasets, instead of where you were (but the URL is intact). This manifests with other pages as well. I suspect this is because Auspice is being too greedy about what it considers a dataset for display.
I won't have time this week to work on this issue, but I did do some digging and wanted to document here for future reference (for myself or anyone else who wants to work on this):
An event listener monitors for popstate event in /src/components/framework/monitor.js
A popstate event would trigger the changePage action in /src/actions/navigation.js
If the path has changed, then dispatch with:
action.type : PAGE_CHANGE
action.displayComponent : "datasetLoader"
This goes to the general reducer in src/reducers/general.js to create a new state for displayComponent
Changes to the displayComponent state leads to re-render of MainComponentSwitch in /src/root.js and returns the DatasetLoader in /src/components/datasetLoader/index.js
The DatasetLoader triggers the loadJSONs action in /src/actions/loadData.js, which calls fetchDataAndDispatch
fetchDataAndDispatch calls getDataset(mainDatasetUrl) which is where the app actually reaches an error:
Trace: Error: not in available datasets
at Object.extendDataPathsToMatchAvailable (/Users/jlee2346/Repos/nextstrain/auspice/cli/server/getDatasetHelpers.js:59:11)
at /Users/jlee2346/Repos/nextstrain/auspice/cli/server/getDataset.js:9:15
at Console.trace (internal/console/constructor.js:336:11)
at /Users/jlee2346/Repos/nextstrain/auspice/cli/server/getDataset.js:13:15
[warning] couldn't fetch JSONs -- not in available datasets
After writing all that out, I'm also not entirely sure in which step should changes be made to ensure that auspice is not being "too greedy"
There's some weird behaviour with Auspice modifying page history such that the back button breaks. For example, go to https://nextstrain.org/staging, observe you get a list of staging datasets and no 404 message, click a dataset, click the back button. You end up with a 404 message and a list of "live" datasets, instead of where you were (but the URL is intact). This manifests with other pages as well. I suspect this is because Auspice is being too greedy about what it considers a dataset for display.
Discussion about this started here: https://bedfordlab.slack.com/archives/C116R9PR7/p1568322725029100
The text was updated successfully, but these errors were encountered: