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

make rootModel setSession check and attempt to remove undefined MST refs #1353

Merged
merged 2 commits into from
Oct 30, 2020

Conversation

rbuels
Copy link
Contributor

@rbuels rbuels commented Oct 30, 2020

Attempts to filter out undefined references in sessions at load time as much as possible. It can't get everything, but it does validate all the references at the time that you set the session, so at least you can handle the undefined ref at session load time.

Adds logic in Loader.tsx to handle the new undefined ref errors thrown setSession, which is what actually addresses the problem in #1275.

this is an alternate approach to #1275, but they might possibly be able to work together, could consider testing that.

@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #1353 into master will increase coverage by 0.12%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1353      +/-   ##
==========================================
+ Coverage   59.53%   59.65%   +0.12%     
==========================================
  Files         418      418              
  Lines       18674    18709      +35     
  Branches     4384     4393       +9     
==========================================
+ Hits        11117    11161      +44     
+ Misses       7271     7262       -9     
  Partials      286      286              
Impacted Files Coverage Δ
products/jbrowse-web/src/Loader.tsx 69.84% <33.33%> (-1.36%) ⬇️
products/jbrowse-web/src/rootModel.ts 57.74% <73.33%> (+2.55%) ⬆️
plugins/dotplot-view/src/DotplotView/model.ts 50.61% <0.00%> (+0.61%) ⬆️
packages/core/util/index.ts 83.95% <0.00%> (+0.68%) ⬆️
packages/core/rpc/coreRpcMethods.ts 86.95% <0.00%> (+1.44%) ⬆️
...pes/renderers/ComparativeServerSideRendererType.ts 90.00% <0.00%> (+4.00%) ⬆️
plugins/dotplot-view/src/DotplotTrack/index.ts 84.28% <0.00%> (+15.71%) ⬆️
...otplot-view/src/ServerSideRenderedBlockContent.tsx 80.00% <0.00%> (+16.00%) ⬆️

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 09f49e9...1dfbf6f. Read the comment docs.

@rbuels rbuels marked this pull request as draft October 30, 2020 03:55
@rbuels rbuels requested a review from cmdcolin October 30, 2020 04:49
@cmdcolin
Copy link
Collaborator

Looks good to me, it passes the test for loading a track that is undefined at the least!

@cmdcolin
Copy link
Collaborator

There was this idea where configReference could use a safeReference and that would ideally have a similar behavior, and I can't remember why this doesn't end up working

@cmdcolin
Copy link
Collaborator

( safereference has the nice behavior of "removing itself from array or map" similar to this pr https://mobx-state-tree.js.org/concepts/references)

but ya, I had tried to make that change at one point and it just didn't really work

@rbuels rbuels mentioned this pull request Oct 30, 2020
@rbuels rbuels marked this pull request as ready for review October 30, 2020 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants