Center-for-Research-Libraries / vufind

CRL Implimentation of VuFind frontend for FOLIO. A library resource discovery portal designed and developed for libraries by libraries
GNU General Public License v2.0
1 stars 0 forks source link

Remove homepage healthcheck #146

Closed ryan-jacobs closed 2 years ago

ryan-jacobs commented 2 years ago

VuFind by default includes an ILS health check component on the homepage. This component (enabled in [Homepage] section of search.ini and defined in https://github.com/Center-for-Research-Libraries/vufind/blob/crl-dev/themes/bootstrap3/templates/ContentBlock/IlsStatusMonitor.phtml) activates an ajax call after the page is loaded which then does a test lookup to the ILS in an effort to check the connection. Unfortunately this healthcheck is broken for FOLIO. By default the check tries to get the holdings of bib ID of integer 1, and if it gets a response it assumes the ILS is up. Our implementation of FOLIO never has/had a bib ID of 1, so the test will always fail.

To make things even more interesting, the ramifications of the health check failure are conditional depending on the settings of loadNoILSOnFailure. The failing health check will always trigger an exception thrown from the FOLIO ILS driver, which is caught in https://github.com/Center-for-Research-Libraries/vufind/blob/crl-dev/module/VuFind/src/VuFind/ILS/Connection.php#L1113 such that:

We absolutely want loadNoILSOnFailure to be true so that record pages will render from the search index even when holdings lookups are failing. Without this, any connection issue with FOLIO could lead to user-facing fatal errors (code 500) and the appearance that the whole system is down. However, turning loadNoILSOnFailure to true is now causing this "System Under Maintenance" message to be added to the homepage even when the FOLIO connection is working.

We could try to get the health check to work properly by overriding some of the connection classes and hardcoding a real bib ID (instead of integer 1) to use for the healthcheck, but for now I suggest we simply short-circuit this whole problem and remove the health check from the homepage altogether. This component does not seem to add much value, and if there is a real problem with the FOLIO connection, we will be alerted to it on all Records pages when they show an ILS Offline message in place of the holdings in a user-friendly way (per the loadNoILSOnFailure logic).