Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App doesn't check that dwCheckApi is online before searching #6

Open
GaProgMan opened this issue May 5, 2017 · 4 comments
Open

App doesn't check that dwCheckApi is online before searching #6

GaProgMan opened this issue May 5, 2017 · 4 comments

Comments

@GaProgMan
Copy link
Owner

Because the app doesn't check whether dwCheckApi is online before sending a search, the user is left staring at a "Searching, please wait" message whilst it (dwCheckApi) spins up. This leads to a bad user experience, as all searches are very quick usually.

To get around this, send some kind of small request when any of the search screens loads. When dwCheckApi responds, enable the search controls. If there is no response, display a message to the user saying that functionality has been disabled (or something similar).

While waiting for a response from the server, display a "please wait" type message informing the user that they will have to wait.

Or send a fire and forget request on first load (from the server side code?), which will force dwCheckApi to spin up if it is closed.

Perhaps we need an API endpoint to call on dwCheckApi which will return a status enum (Started OK, Database Issue, +++Out of Cheese Error+++, etc.)

@GaProgMan GaProgMan self-assigned this May 5, 2017
@GaProgMan
Copy link
Owner Author

dwCheckApi version 2 has an api endpoint for checking the version.

We could put fire off a get request to that whilst dwCheckUI is starting up, and await a response. Once a response is received, we can be sure that dwCheckApi is running.

We'd have to do something if a response is not received though.

@GaProgMan
Copy link
Owner Author

Part of this work has been carried out in commit e59b7cd.

All component specific xhrs use a common xhr method in the base component. This base xhr method performs a check to ensure that the api is running before submitting the xhr. This check needs to be moved to a method which can be called as the component opens, rather than when the user requests an action - that way, while the user it deciding what to do, we can be checking whether the api is running.

@brendoncaulkins
Copy link

Would you prefer this to happen on app load, or would performing the check on the first call and remembering the result for subsequent calls suffice? Is there ever a need to re-check after the initial check? ( I would assume not, since you're communicating with the service thereafter...)

@GaProgMan
Copy link
Owner Author

I feel like a check during subsequent calls would suffice.
Perhaps a toast-like message which informs the user that the API is down at the moment would be useful. That way, they're not sitting around waiting for the request to time-out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants