Feature #2805
closedClient should be able to handle connection failures and failed ajax requests gracefully
0%
Description
Would be nice if the client received notifications regarding connection state information and could handle failures gracefully. This would allow the end user to know why things have suddenly stopped working. Currently there is no notification other then console errors. This is particularly problematic with mobile applications where connectivity is inconsistent. It would be nice if you could provide javascript code to be run for the following events.
*failed ajax requests.
*disconnected from the webserver because of connectivity problems
*disconnected from the webserver because the webserver was shutdown.
*reconnected to the webserver.
Looks like most of the foundation already exists to do this. The javascript console in chrome is reporting net::ERR_CONNECTION_REFUSED with a backtrace(below). There looks to be code to track the connection state already, it's just unclear how to do anything with it on the client side.
POST http://<URL>&wtd=a8y1STBlrYynijRD net::ERR_CONNECTION_REFUSED :163
h :163
window.Wt3_3_1.initAjaxComm.d.sendUpdate :163
h :223
b :221
(anonymous function)
Updated by Koen Deforche over 9 years ago
- Status changed from New to InProgress
- Assignee set to Benoit Daccache
We'll need to design an API first.
Updated by Benoit Daccache over 9 years ago
- Status changed from InProgress to Resolved
Added WApplication::setConnectionMonitor(jsObject) that will trigger jsObject.onChange(type, oldValue, newValue) when connected and disconnected
However it is not yet possible? to detect Ajax CONNECTION_REFUSED or ERR_INTERNET_DISCONNECTED to detect a server crash
Updated by Koen Deforche about 9 years ago
- Status changed from Resolved to Closed