IDR / idr-gallery

https://pypi.org/project/idr-gallery/
GNU Affero General Public License v3.0
1 stars 1 forks source link

Fix handling of no studies.tsv containers for studyId #19

Closed will-moore closed 2 years ago

will-moore commented 2 years ago

Fixes a bug seen on idr-next when the studies.tsv doesn't contain a study that is in the DB. When looking-up image counts (to display in the auto-complete panel) the containers which is coming from the studies.tsv is undefined if the study ID is not found in studies.tsv - idr-next currently has idr0141 which is missing from https://raw.githubusercontent.com/IDR/idr.openmicroscopy.org/master/_data/studies.tsv

This gives the following error in console:

Screenshot 2022-09-23 at 10 28 31

The code fix moves a check for this to before the containers.filter() that generates the bug.

pwalczysko commented 2 years ago

Code makes sense. To reproduce the bug on idr-testing is not successful, so I would propose to merge and deploy on idr-next , cc @jburel

Edit - we were able to reproduce the error after all, see next comment

pwalczysko commented 2 years ago

We are now reproducing the bug on idr-testing successfully, see screenshot of the Console from Chrome on idr-testing when searching for p Screenshot 2022-09-23 at 11 28 13

Next step : @will-moore is deploying this fix to idr-testing. Expectation: the error will not appear, the dropdown will appear

cc @jburel @francesw

pwalczysko commented 2 years ago

After deployment of this fix on idr-testing we have

Screenshot 2022-09-23 at 11 32 41 Screenshot 2022-09-23 at 11 32 36