GMOD / bbi-js

Parser for bigwig and bigbed files
MIT License
8 stars 6 forks source link

Fix refetch for certain files #57

Closed cmdcolin closed 1 year ago

cmdcolin commented 1 year ago

I tested locally and it fixes https://github.com/GMOD/bbi-js/issues/56

The issue was that the code "refetches" if the header is detected to exceed a certain size. BAM code does this as well as there is nothing that tells you upfront that the header is a certain size, so you just keep refetching if the initial request doesn't capture enough data

The amount we fetch is pretty conservative, only 2000 bytes to start, and could be increased perhaps, but this test data helped exercise this code path better.

rbuels commented 1 year ago

Nice catch!