open-reaction-database / ord-interface

Search/browse interface and APIs for the Open Reaction Database
https://open-reaction-database.org
Apache License 2.0
18 stars 9 forks source link

Entering text into the search bar on the Browse page causes content to disappear #90

Closed bdeadman closed 1 month ago

bdeadman commented 7 months ago

As reported to help@open-reaction-database.org by a user. Confirmed that I am also seeing same behaviour on Chrome and Edge.

When we attempt to enter any text into the search interface on the Browse page, it immediately causes the page contents to disappear. The header and footer remain, but the browse window is gone until the page is reloaded.

miori-nd commented 5 months ago

I can provide a fix shortly. Can replicate the issue. It looks like there's an error in the Vue EntityTable component.

TypeError: Cannot read properties of null (reading 'toString')
    at EntityTable.vue:53:31
    at Array.forEach (<anonymous>)
    at EntityTable.vue:52:33
    at Array.forEach (<anonymous>)
    at EntityTable.vue:51:28
    at Proxy.filter (<anonymous>)
    at Proxy.filteredEntities (EntityTable.vue:47:29)
    at w.run (reactivity.esm-bundler.js:178:19)
    at get value (reactivity.esm-bundler.js:1147:33)
    at Object.get [as filteredEntities] (runtime-core.esm-bundler.js:3407:22)

It looks like there's some null data in the Entities that is causing this crash. If we still want this data to be searchable after a fashion, might I suggest patching null values into the string literal "null"? Or something more descriptive like "No data" if you prefer. @bdeadman please let me know your recommendation for what placeholder we should add in place of the null data.

bdeadman commented 5 months ago

@miori-nd thanks for your help. The Vue side of the interface is currently beyond my capabilities to troubleshoot so apologies if I am misunderstanding your suggested fix. If all you are changing is how the Vue interface interprets and/or displays the ORD data then I think you can just pick some sensible text placeholder to use. I'm not aware of any null value values being routinely displayed to the user through the ORD interface so just using "null" should be OK. If you make the fix and we subsequently find lots "nulls" showing up then at least it will help me see where the problem data is coming from.

If we need to patch the placeholder directly into the ord-data repo then we will need to proceed more carefully and go to the rest of the team.

miori-nd commented 5 months ago

@bdeadman Thanks, you have it right! My fix won't change the underlying data, just how it is displayed. So we'll go with "null" for now. Thank you!