Hot Fix: Guard clinical & genomic search against nodes missing discovery counts - #273
Open
mshadbolt wants to merge 1 commit into
Open
Hot Fix: Guard clinical & genomic search against nodes missing discovery counts#273mshadbolt wants to merge 1 commit into
mshadbolt wants to merge 1 commit into
Conversation
The clinical fill-in loop in handleCensoring indexed the discovery counts object by program id (dataObj[siteName][program]) without checking that a per-site bucket existed. When a node returns clinical results but no discovery counts for the same site — offline, timed out, a 403 from federation, or a location-name mismatch between the discovery and clinical responses — dataObj[siteName] is undefined and the access throws "Cannot read properties of undefined (reading '<program>')", which the error boundary surfaces as "Something went wrong" and white-screens the whole clinical & genomic search page. Resolve site.summary?.[dataKey] once and skip nodes with no summary for the category (Object.keys(undefined) would otherwise throw too), and skip the object fill-in when there is no matching discovery bucket for the site. Behaviour is unchanged when discovery and clinical agree on the sites. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
This only fixes the surface problem e.g the data-portal display. It does not fix the underlaying issue why federation failed and we need that for the node to function. I would reject the fix for 2 reasons:
|
Contributor
Author
|
If we don't fix it that means every time one connected node has this issue that the whole network is non-functional. The whole definition of a hot fix is that it is a fix that is needed on stable immediately. Yes all nodes need the fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the clinical & genomic search page, a node can return clinical results but no matching discovery counts for the same site — e.g. the node is offline, timed out, returns a 403 from federation (
Request claims to be from federation but it's not), or itslocation.namediffers between the discovery and clinical responses.When that happens,
handleCensoringindataVisualization.jsxindexed the discovery counts object by program id (dataObj[siteName][program]) without checking the per-site bucket existed.dataObj[siteName]isundefined, so the access throws:(where
AMLis whatever the first program id is). The error boundary catches it and white-screens the entire search page with "Something went wrong".This was seen in production when a federated node's
queryservice rejected the federation service token and returned no discovery counts.Fix
In the clinical fill-in loop:
site.summary?.[dataKey]once and skip nodes that have no summary for the category — this also avoids anObject.keys(undefined)throw.Behaviour is unchanged when the discovery and clinical responses agree on the sites. This is defence-in-depth: the affected node still renders with no counts until its backend issue is resolved, but the page no longer crashes for every other node.
Notes
stable, which already carries the Highcharts header fix #14 censoring fix (Fix Highcharts #14 on censored aggregate charts #269); this adds the missing undefined-bucket guard that Fix Highcharts #14 on censored aggregate charts #269 did not cover.🤖 Generated with Claude Code