-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds safety checks on AlignmentsDisplay properties to avoid undefined rendering #3758
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3758 +/- ##
==========================================
+ Coverage 64.10% 64.11% +0.01%
==========================================
Files 987 987
Lines 29663 29667 +4
Branches 7094 7097 +3
==========================================
+ Hits 19014 19020 +6
+ Misses 10485 10483 -2
Partials 164 164
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
plugins/alignments/src/LinearAlignmentsDisplay/models/model.tsx
Outdated
Show resolved
Hide resolved
@@ -73,7 +73,7 @@ const TrackLabel = React.forwardRef<HTMLDivElement, Props>(function ( | |||
}, | |||
...(session.getTrackActionMenuItems?.(trackConf) || []), | |||
...track.trackMenuItems(), | |||
].sort((a, b) => (b.priority || 0) - (a.priority || 0)) | |||
].sort((a, b) => (b?.priority || 0) - (a?.priority || 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick but is it true that this needs a nullish check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be able to remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was failing on that in testing -- again i wasn't able to explain why exactly it was happening (might have something to do w nextjs and alignments) but yeah.
User experience when opening 2+ AlignmentsTracks one after another using jbrowse-react-linear-genome-view: application would crash on some undefined properties (SNPCoverageDisplay.height, self.PileupDisplay.type, and .priority of menu items)
Might be something weird with next.js rendering / race conditions / not sure what; adding these checks resolves the issue.
Tested on the JBrowse 2 app and everything working the same as before.