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

Ticket #11478 (closed defect: untested)

Opened 8 months ago

Last modified 8 months ago

Ajax.activeRequestCount out of sync after an exception or a failure

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

Description

Ajax.activeRequestCount is not decremented after an exception or a failure. This patch fixes the problem:

Index: D:/dev/main2/Prototype/src/ajax.js
===================================================================
--- D:/dev/main2/Prototype/src/ajax.js	(revision 9167)
+++ D:/dev/main2/Prototype/src/ajax.js	(working copy)
@@ -41,7 +41,9 @@
 
 Ajax.Responders.register({
   onCreate:   function() { Ajax.activeRequestCount++ }, 
-  onComplete: function() { Ajax.activeRequestCount-- }
+  onComplete: function() { Ajax.activeRequestCount-- },
+  onFailure: function() { Ajax.activeRequestCount-- },
+  onException: function() { Ajax.activeRequestCount-- }
 });
 
 Ajax.Base = Class.create({

Change History

03/31/08 20:55:34 changed by kangax

I'm not sure how important it is. After all, you could easily add such responder yourself.

03/31/08 21:56:36 changed by Tobie

  • status changed from new to closed.
  • resolution set to untested.

Are you sure about onFailure ? Also for onException it probably depends from where the exception callback was triggered.

Please provide us with failing testcases.