Skip to content
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

Fix crash when there are undefined references in the state tree e.g. when a track is deleted but still referred to by a session #1597

Merged
merged 8 commits into from
Jan 8, 2021

Conversation

peterkxie
Copy link
Contributor

Uses @rbuels #1353 fix that filters out undefined references at loadtime while making it work with dotplot. Autorun is added to dotplot model to only making the abortable action after the view is initialized. Closes #560

@peterkxie peterkxie self-assigned this Jan 5, 2021
@codecov
Copy link

codecov bot commented Jan 5, 2021

Codecov Report

Merging #1597 (94bed29) into master (b15d5ca) will increase coverage by 0.01%.
The diff coverage is 72.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1597      +/-   ##
==========================================
+ Coverage   59.18%   59.20%   +0.01%     
==========================================
  Files         438      438              
  Lines       19927    19948      +21     
  Branches     4680     4686       +6     
==========================================
+ Hits        11794    11810      +16     
- Misses       7839     7844       +5     
  Partials      294      294              
Impacted Files Coverage Δ
products/jbrowse-web/src/Loader.tsx 70.04% <33.33%> (-1.24%) ⬇️
products/jbrowse-web/src/rootModel.ts 56.30% <75.00%> (+3.14%) ⬆️
plugins/dotplot-view/src/DotplotDisplay/index.ts 69.44% <100.00%> (+1.79%) ⬆️
packages/core/util/Base1DViewModel.ts 71.54% <0.00%> (-0.23%) ⬇️
...management/src/AssemblyManager/AssemblyAddForm.tsx 66.66% <0.00%> (ø)
products/jbrowse-web/src/ShareButton.tsx 10.20% <0.00%> (+0.10%) ⬆️
...s/linear-genome-view/src/LinearGenomeView/index.ts 80.87% <0.00%> (+0.47%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b15d5ca...37e4d54. Read the comment docs.

@cmdcolin
Copy link
Collaborator

cmdcolin commented Jan 6, 2021

can you check the diff for this being changed?

also I will just pontificate for a moment: the change to rootmodel means this logic is centralized which is nice in some ways but in other ways, any user of say @jbrowse/react-linear-genome-view will not get this functionality and thus needs to duplicate it in their own app

there are a number of types of things like this where our jbrowse 2 app has nice features, but embedded mode kind of leaves some stuff to be wanted. this is another thing about our general messaging about embedded mode: it's not necessarily a batteries included product

@cmdcolin
Copy link
Collaborator

cmdcolin commented Jan 6, 2021

meant to say: can you check the diff for the CLI README being changed? just curious if that's a real thing or some artifact

@peterkxie
Copy link
Contributor Author

I think thats an artifact, didnt touch anything related to the CLI

@rbuels
Copy link
Contributor

rbuels commented Jan 6, 2021

maybe these commits need to be rebased onto master? that CLI readme thing shouldn't be in this PR

@peterkxie peterkxie force-pushed the 560_fix_jbweb_crash branch from 94bed29 to ad9a2fd Compare January 6, 2021 19:34
@peterkxie
Copy link
Contributor Author

rebased the branch, CLI seems to be gone from diff

Comment on lines 75 to 93
const parent = getContainingView(self) as DotplotViewModel
autorun(reaction => {
if (parent.initialized) {
makeAbortableReaction(
self as any,
renderBlockData,
renderBlockEffect as any,
{
name: `${self.type} ${self.id} rendering`,
delay: 1000,
fireImmediately: true,
},
this.setLoading,
this.setRendered,
this.setError,
)
reaction.dispose()
}
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This nested autorun-reaction thing is a little frightening, I'm not sure what it might do in corner cases.

What if you added the if(parent.initialized) logic to the renderBlockData and renderBlockEffect functions instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try that out

@garrettjstevens garrettjstevens added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Jan 6, 2021
@peterkxie peterkxie marked this pull request as draft January 7, 2021 00:25
@peterkxie peterkxie added bug Something isn't working and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Jan 7, 2021
@cmdcolin
Copy link
Collaborator

cmdcolin commented Jan 8, 2021

@peterkxie i think this code is ok and ready to merge.

the dotplot view is simply a flaky test #1221

in order to properly fix #1221 I think what we would want to do is insert console.log statements at many positions leading up to where it is generating the prerendered_canvas, and see why it gets stuck and doesn't get there

@cmdcolin cmdcolin force-pushed the 560_fix_jbweb_crash branch from 9152109 to 37e4d54 Compare January 8, 2021 02:14
@cmdcolin cmdcolin marked this pull request as ready for review January 8, 2021 02:14
@cmdcolin cmdcolin merged commit 69bc750 into master Jan 8, 2021
@cmdcolin cmdcolin changed the title Fix JBrowse Web Crash Fix crash when there are undefined references in the state tree e.g. when a track is deleted but still referred to by a session Jan 8, 2021
@cmdcolin cmdcolin deleted the 560_fix_jbweb_crash branch January 8, 2021 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JBrowse web crashes after refresh when a track that is deleted from config.json is loaded in the instance
4 participants