nextclade
nextclade copied to clipboard
ENH: don't crash browser if too many sequences dropped, stop prematurely
I just dropped around 5k SC2 sequences in v2 Nextclade web.
Unfortunately, the browser crashed.

At least 3k sequences were processed correctly.
It would be nice if we didn't crash the browser but instead stopped after say 2k sequences are aligned and explicitly ask the user whether they want to proceed - so they would not waste the computation and could at least look at the results they already had.
Maybe we could even detect when the browser runs out of memory to prevent the crash.
That's very tricky. It's tricky to count how many were processed, and tricky to pause or cancel the algorithm. There are no usual concurrent primitives for webworkers, so some hackery will need to be figured out probably. I don't know how to approach that at the moment.
Perhaps it's easier to just tell users not to do silly things in advance. It says so in the docs, I think.
Right, I can see how it's not easy. Maybe the fasts reader can keep track of number of sequence though? And just stop dispatching?