Ajax "loading" spinners go forever when request fails
Bug #1305352 reported by
Aaron Wells
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Users are always coming to us with problem descriptions that sound like this, "I uploaded something and the spinner kept loading forever," or, "I tried to install and it kept saying loading forever".
The problem is that when we do stuff via ajax we put up a "loading" spinner until the request comes back. But, if the request fails, then the spinner never comes down and the user waits and waits and waits, and thinks that the problem is a timeout rather than a server back-end error.
It would be good if we could come up with an across-the-board solution for this.
Changed in mahara: | |
status: | New → Confirmed |
Changed in mahara: | |
assignee: | nobody → raf (rafaelgoesmann) |
Changed in mahara: | |
assignee: | raf (rafaelgoesmann) → nobody |
To post a comment you must log in.
A few possible solutions:
1. A timeout on the spinner. If it waits too long, the spinner goes away and is replaced with an error notifier. The problem with this, is knowing how long to make the timeout. If a long-running request is actually still going on, then changing to "error" may cause some inconsistent results (unless we can also kill the request?). Different timeouts may be appropriate for different ajax calls, so this should be an optional parameter.
2. Make the ajax response scripts more robust, so that they always return a valid response, no matter what. This might be something we could do by perhaps using a different error handler if you set the JSON flag on a script.
3. Make the ajax request code more robust, so that if it receives a garbled response, it switches to an error message.
I haven't looked into this too deeply yet, so I'm not sure whether, in a failure, the script on the server returns no response, or whether it returns a response that is not valid json. This could affect which choice is best. It's possible that we should implement more than one of these options.