PoonLab / covizu

Rapid analysis and visualization of coronavirus genome variation
https://filogeneti.ca/CoVizu/
MIT License
45 stars 20 forks source link

Node server crashed due to a failed search #522

Closed GopiGugan closed 4 months ago

GopiGugan commented 4 months ago
dbmanager::get_hits found 0 docs ba.2
dbmanager::get_hits found 0 docs ba.2.
dbmanager::get_hits found 0 docs ba.2.8
dbmanager::get_hits found 0 docs ba.2.86
dbmanager::get_hits found 0 docs ba.2.86.
dbmanager::get_hits found 0 docs ba.2.86.1
dbmanager::get_lineage found no records for cindex=2657
/opt/app/dbmanager.js:120
            var rawLineage = doc["raw_lineage"];
                                ^

TypeError: Cannot read properties of null (reading 'raw_lineage')
    at /opt/app/dbmanager.js:120:33
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

We should add a try/catch to make sure it doesn't crash the node server

ArtPoon commented 4 months ago

Page is not loading, is that related to this issue?

GopiGugan commented 4 months ago

The issue was that there was a space added to the end/start of the string. I've modified the search to strip whitespaces at the beginning and end of the query string and I've added a check to ensure that the node instance does not crash when there isn't a record in the database