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 chromSizesLocation not specified when loading TwoBitAdapter in GUI #2444

Merged
merged 1 commit into from
Oct 25, 2021

Conversation

cmdcolin
Copy link
Collaborator

Currently loading a twobit file from the desktop start screen fails, and fails with a big snapshot failure that crashes the app

There is a assumption in some usages of FileSelector where a "blank location object" is {uri:''}

Then, with TwoBitAdapter in particular, the "chromSizesLocation" is an optional entry that speeds up loading the twoBit, but if chromSizesLocation is not specified, then loading fails.

Specifically, it fails to go through the FileLocation preprocessor however because empty string doesn't pass the check

if(uri) {
}

This PR explicitly checks for

if(uri!==undefined) {
}

this helps the locationType get added, and therefore not have an big app crashing error

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Oct 25, 2021
@codecov
Copy link

codecov bot commented Oct 25, 2021

Codecov Report

Merging #2444 (17a0402) into main (1946bbb) will decrease coverage by 0.05%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2444      +/-   ##
==========================================
- Coverage   61.14%   61.09%   -0.06%     
==========================================
  Files         538      538              
  Lines       25079    25079              
  Branches     5857     5857              
==========================================
- Hits        15335    15322      -13     
- Misses       9426     9439      +13     
  Partials      318      318              
Impacted Files Coverage Δ
packages/core/util/types/mst.ts 84.37% <66.66%> (ø)
...inearGenomeView/components/RefNameAutocomplete.tsx 75.26% <0.00%> (-10.76%) ⬇️
packages/core/TextSearch/TextSearchManager.ts 96.55% <0.00%> (-3.45%) ⬇️
...gins/svg/src/SvgFeatureRenderer/components/util.ts 96.07% <0.00%> (-1.97%) ⬇️
...gFeatureRenderer/components/ProcessedTranscript.js 85.13% <0.00%> (-1.36%) ⬇️
products/jbrowse-web/src/util.ts 27.27% <0.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 1946bbb...17a0402. Read the comment docs.

@cmdcolin cmdcolin 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 Oct 25, 2021
@cmdcolin cmdcolin changed the title Fix issue loading twobit file at desktop start screen if chromSizesLocation not specified Fix crash when chromSizesLocation not specified when loading TwoBitAdapter in GUI Oct 25, 2021
@cmdcolin cmdcolin merged commit 0512c21 into main Oct 25, 2021
@cmdcolin cmdcolin deleted the fix_twobit_loading branch October 27, 2021 03:48
cmdcolin added a commit that referenced this pull request Nov 1, 2021
…ad of falsey to avoid issue with blank url failing (#2444)
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.

None yet

1 participant