nextstrain / nextclade

Viral genome alignment, mutation calling, clade assignment, quality checks and phylogenetic placement
https://clades.nextstrain.org
MIT License
216 stars 58 forks source link

[minor] Auspice dataset functionality: URL redirects don't update displayed metadata #1475

Open jameshadfield opened 4 months ago

jameshadfield commented 4 months ago

Minor bug: https://nextstrain.org/flu/seasonal/vic/na/2y is a redirect (302) to https://nextstrain.org/seasonal-flu/vic/na/2y (we have quite a few redirects within nextstrain these days)

When using this as a dataset for within nextclade - https://clades.nextstrain.org/?dataset-json-url=https://nextstrain.org/flu/seasonal/vic/na/2y - the auspice dataset is correctly fetched (i.e. redirects are followed) but the shown metadata isn't updated:

image
ivan-aksamentov commented 4 months ago

@jameshadfield Can you tell me a little bit more about what you mean by metadata? What's the expected result?

At first I thought it's about the .meta.extensions.nextclade.pathogen, but I don't see it in JSON, so it must be something else.

ivan-aksamentov commented 4 months ago

Perhaps you mean the URL? Then it just shows the original URL from the incoming URL param. Would it not be surprising if, as a user, you pass one thing and it shows you something else? I'd be confused.

In terms of implementation, I don't know how hard it would be to also get the final URL out of axios. It must be on a response object probably. But I have a few wrappers on top of it, so probably not very immediate to implement.

Does the final URL even matter to the user? :)

jameshadfield commented 4 months ago

Perhaps you mean the URL? Then it just shows the original URL from the incoming URL param. Would it not be surprising if, as a user, you pass one thing and it shows you something else? I'd be confused.

Yeah I do (I shouldn't have used "metadata"). The best behaviour (IMO) would be to update the URL param to reflect the redirect which occurs behind the scenes, and also update the URL shown in the UI. But perfect is the enemy of good and I can appreciate this isn't a one-line change. Happy for "won't fix" - especially as such URLs would have to be manually constructed by users - but wanted to use this venue to surface it.