chanzuckerberg / galago

Interpretation aids for genomic epidemiology
https://chanzuckerberg.github.io/galago/
MIT License
8 stars 3 forks source link

Detect malformed tree JSON, do something about it #183

Closed vincent-czi closed 2 years ago

vincent-czi commented 2 years ago

Some kind of function that does a sanity check on an incoming tree object to make sure that it really is in the format of a Nextstrain tree. Right now if the user comes in with a fetch URL pointed at the wrong data (or just uploads a totally wrong JSON, for that matter), there's no warning. Everything continues seems to be fine until they try to select their State/Province and the list of options is empty (because parsing those options produces nothing since it's not really a tree).

Image

We probably want to pair this with creating some kind of error message that pops up when the user gives us a bad tree for ingestion, along with blocking however the app would normally progress (eg, showing the Upload Modal to add in more details).