Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10191 (new enhancement)

Opened 2 years ago

Last modified 1 year ago

[PATCH] Ajax network errors fire on0 + onFailure, local files fire onSuccess

Reported by: kendsnyder Assigned to: sam
Priority: normal Milestone: 2.x
Component: Prototype Version: edge
Severity: normal Keywords: 1.6.1 discuss
Cc:

Description

Ajax enhancements per Tobie.

TOBIE: " Just discussed the other points with Andrew.

To summarize:

- file protocol should always return success. - previously mentioned non-standard status codes for IE should always return a status code of 0. - status code of 0 should trigger an onFailure callback (except obviously for the file protocol). - status code of 0 should trigger an on0 callback. - as the specs don't yet specify that an exception should be raised in case of a network error, we won't implement that for the moment. So a status code of 0 will not trigger an onException callback. "

also see http://groups.google.com/group/prototype-core/browse_thread/thread/ab3f5f2c1b8fdd7f/70a6bea9cc4e0558 http://groups.google.com/group/prototype-core/browse_thread/thread/1e657fad735d86de/fb6ad6b04a988e7a

Attachments

ajax.js.diff (1.3 kB) - added by kendsnyder on 11/16/07 20:25:25.
Patch

Change History

11/16/07 20:25:25 changed by kendsnyder

  • attachment ajax.js.diff added.

Patch

11/16/07 20:26:05 changed by kendsnyder

Fixes #4267 and #10030

11/16/07 20:47:48 changed by Tobie

  • keywords set to 1.6.1.

Hi Ken, thaks for the patch.

I did a lot of testing my self on the same issue over the last couple of days and this will have to wait for 1.6.1 or maybe even 2.0.

There's a lot more issues at hand than the ones you handle here.

Notably, Firefox's xhr.send method will throw an error if the network is down, there's also a fancy -1004 status that appears in WebKit from time to time, etc.

This needs a lot more research and dev. Probably dispatching different types of errors to different controllers, adding a timeout, etc.

Clearly too much for the upcoming bug fix release.

11/16/07 20:50:54 changed by Tobie

Also, if we want to be able to test this seriously, we'll need a testing environment that allows simulating network errors.

Any pointers to something of that kind related to webrick would be awsome.

11/19/07 04:55:16 changed by Tobie

btw: YUI considers 1223 as a 204...

01/29/08 13:13:47 changed by Tobie

  • keywords changed from 1.6.1 to 1.6.1 discuss.
  • summary changed from [PATCH] Ajax network errors fire on0 + onFailure, local files fire onSuccess to Ajax network errors fire on0 + onFailure, local files fire onSuccess.

This should be coupled with a timeout callback

04/03/08 13:27:21 changed by jdalton

04/03/08 13:28:25 changed by jdalton

04/03/08 13:30:22 changed by jdalton

  • summary changed from Ajax network errors fire on0 + onFailure, local files fire onSuccess to [PATCH] Ajax network errors fire on0 + onFailure, local files fire onSuccess.

04/05/08 05:49:48 changed by jdalton

this ticket #11434 mentions a solution to a dropped
connection in Firefox. Maybe it can be used in other browsers as well.