plazi / BLR-website

1 stars 0 forks source link

testing website 20200330 #32

Closed myrmoteras closed 4 years ago

myrmoteras commented 4 years ago

http://blr.uplaysandbox.website/

searching for "Agostii" What are the results? This has nothing to do with Agosti

image

searching for Agosti = Taxon

blank screen image

teodorgeorgiev commented 4 years ago

When the API return results (http://z2.punkish.org/v2/treatments?facets=true&stats=true&q=agosti), the response looks like that (as it was): { "value": { "search-criteria": {

When there are no results (http://z2.punkish.org/v2/treatments?facets=true&stats=true&journalTitle=agosti) the structure of the response has been changed to: { "search-criteria": {

Before it has the same structure, no matter if there are results or not.

@punkish could you please fix that

punkish commented 4 years ago

Another wonderful bug report, thanks. Fixed.

explanation: you found a real edge case – when the cache is off (which would never be in a production env) and when searching for a single record (presence of treatmentId) and failing to find it.

fixed a few other things as well.

Note: Once again, please note, this was not a bug in the website. This was a bug in the API. Hence, the correct place to report it would be the zenodeo issues tracker. Let's try and keep the issues straight as that will really help fix the right things.

A bit more explanation of the logic behind the last note. Let's say I am making a website that uses the Github API. Something goes wrong with the API and my users see my website is crashing. The users will report a bug on the website issues tracker, and I will report the related bug on the Github API issues tracker.

Ideally, the API and the website are completely decoupled, so the API has no knowledge of the apps that are using it (although, of course, the apps have knowledge of the API). All it promises is to adhere to the contract it has made, that is, never break existing and public APIs. Which is why, older versions of Zenodeo API will continue to function even long after they've been left behind :). That is the vision we want to pursue.