Project

General

Profile

Actions

Feature #2805

closed

Client should be able to handle connection failures and failed ajax requests gracefully

Added by mat Sch over 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Benoit Daccache
Target version:
Start date:
03/12/2014
Due date:
% Done:

0%

Estimated time:

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)

Actions #1

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.

Actions #2

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

Actions #3

Updated by Koen Deforche about 9 years ago

  • Status changed from Resolved to Closed
Actions #4

Updated by Koen Deforche about 9 years ago

  • Target version set to 3.3.5
Actions

Also available in: Atom PDF