Skip to content

Sidecars don't work when changing dataset via the sidebar (under certain conditions) #1855

Open
@jameshadfield

Description

@jameshadfield

When changing between two datasets via the sidebar dropdown UI, each with a tip frequencies sidecar, we saw someone get a warning banner indicating a failure to normalise frequencies and the sidebar option is not available. The relevant code for the sidebar is:

const allowNormalization = this.props.frequencies.loaded && this.props.tree.loaded &&
checkIfNormalizableFromRawData(
this.props.frequencies.data,
this.props.frequencies.pivots,
this.props.tree.nodes,
this.props.tree.visibility
);
if (!allowNormalization) {
return (
<SidebarSubtitle>(Frequencies cannot be normalized)</SidebarSubtitle>
);

and checkIfNormalizableFromRawData seems to always return true (!)

const allowNormalization = true;
return allowNormalization;

implying a race condition around this.props.frequencies.loaded && this.props.tree.loaded.

Reloading the page works as expected.

I don't have any reproducible datasets (have asked for them), and note that changing https://nextstrain.org/seasonal-flu/h3n2/ha/3y to 2y (via sidebar) works as expected. Perhaps it's dataset specific (hard to understand after skimming the relevant code) or using an old version of auspice (normalisation checking was removed in 7b9495b in 2001)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsource: office hoursIssue mentioned during office hours

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions