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.
currently, cram-js tries to access the "file size" but this requires special CORS configurations when accessing cross origin files that not all servers have
I determined that a major contributor to the "need" for file length check was a "test only" method called containerCount. while it containerCount could potentially be used by people outside of our tests, it is uncommon for web usage. threfore, i found a way to fix it where it just catches an error reading past the end of the file with a try/catch
random note: one of the tricky files to handle corectly with this PR was "test/data/grc37-1#HG03297.mapped.ILLUMINA.bwa.ESN.low_coverage.20130415.bam.cram"
I found that it was referencing 'mate records' that were undefined. this was maybe due to performing samtools view on a slice of the file, which resulted in it referring to mates in other slices. potentially it could be investigated further, but this PR has 100% matching snapshots still.
this PR does propagate some "undefined's" (where ::decode() can return undefined now) through the type system, related to where that decode can fail, related to what i hypothesize is that mate record not being defined, but the type system checks this edge case well and so it is accomodated by some basic workarounds for that undefined condition.
this is a re-attempt at #131