Check that breakpoint split view is ready before fetching to avoid crash/large data fetching #5037
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.
Background - prehistory
The breakpoint split view, for better or worse, fetches features independently of the tracks
This is because the tracks don't have full info about the features that they contain, because this is slow due to serialization of data over webworker
Background - this issue
The breakpoint split view calls CoreGetFeatures independently of the tracks. However, it doesn't check if it is appropriate to call getFeatures (e.g. if it is looking at too large an area)
This can cause it to trigger very large data downloads accidentally in some cases, and this came up when re-navigating breakpoint split views
This fix
This PR fixes it by checking for the track.displays[0] being not not ready. This may not be a complete solution even in itself yet, because it only checks the flag on the first instance of the track e.g. not both levels of the breakpoint split view
Fixes #5026
Random background
We use the term notReady instead of ready because if a track sets the ready flag to undefined, that does not necessarily mean it is not ready even though that is falsy...we try to look for genuine signals from tracks who define the concept of them being not ready but looking for notReady true, which avoids having to reason about ready:undefined being not ready or not