stripes should halt if the request for a tenant's modules fails
Description
CSP Request Details
CSP Rejection Details
Potential Workaround
relates to
Checklist
hideTestRail: Results
Activity

Jason Skomorowski May 9, 2019 at 7:44 PMEdited
I still stand by . I don't think we should be probing for services at login and would rather we spent the resources on making the system error as gracefully as possible when a service it expected is not available / not responding / reports itself as a different version than what we require.
Stripes' modules express dependencies on backend services, we should not rely on a probe running once at login in each user's browser to guarantee that – if the backend configuration for the tenant doesn't match the bundle we want to be able to verify that before we start serving it up. What the JS in user browser's should do is provide good error reporting in extraordinary situations and those can happen at any time – just because mod-circulation was up when you logged in doesn't mean it'll still be up in an hour or two.
Having a developer console that lets us get a nice overview of what's actually running on the backend for testing purposes while we're putting this together? Sure. But for production use I just don't see this as a good approach. So this specific issuse (requests to Okapi endpoints to scour for versions) is low/non-priority by my reckoning however the more general problem of clearly surfacing errors encountered when communicating with backend services is well worth exploring and something we should do robustly. That is blocked by the way we communicate with the backend being up in the air at the moment eg. we need to commit to graphql or decide what stripes-connect should look like and plan out its development.
Under some circumstances (ahem, FOLIO-1751), requests to
_/version
and_/proxy/tenants/diku/modules?full=true
fail, but stripes continues to load and allow users to login. This seems disingenuous: the backend is essentially reporting that no modules are available, but stripes is proceeding merrily on its way. This leads to discord in the UI, where most blocks of code run as usual but any blocks wrapped in<IfInterface>
tags are hidden.One approach to fixing this would be wrap all code in
<IfInterface>
tags. While arguably not wrong, it also seems not quite right. If no interfaces are present, stripes should halt and display an error message.