vgteam / sequenceTubeMap

displays multiple genomic sequences in the form of a tube map
MIT License
180 stars 25 forks source link

Stop TubeMapContainer from racing different updates or re-rendering with old data and new color schemes #357

Open adamnovak opened 1 year ago

adamnovak commented 1 year ago

In https://ucsc-ci.com/vgteam/vg/-/jobs/54068/raw, some vg CI tests failed because, in the file upload test, we never got to the end of the test case.

It seems like this might have something to do with the file being uploaded, the go button being hit, and the tube map re-rendering with the old node and read data but the new color schemes, instead of/before getting the view of the uploaded file back from the server.

TubeMapContainer is based around a bunch of imperative setState-ing of one big loading flag, which isn't actually quite constrained to agree with the number of web requests in flight. The setState updates are all object-based, and not function-based, so we might e.g. clobber data requested later with data requested earlier. And the loading flag being wrong could cause an unwanted re-render of the actual tube map with stale data.

We should work out a better system for tracking whether the TubeMapContainer has the data corresponding to the view target currently in its props or not. If it doesn't, it shouldn't be rendering any tube maps, no matter how many web requests for old views are arriving.