Comment 1 for bug 1305352

Revision history for this message
Aaron Wells (u-aaronw) wrote :

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.