respondToReadyState is called with a random readyState
Reported by Comron Sattari | June 25th, 2008 @ 08:21 PM
Related to : http://prototype.lighthouseapp.c...
I've noticed some failing AJAX calls on FF2 and FF3 that like the ones listed in the ticket above do not violate SOP and do not return 404. I've traced the problem down to the same exact line as listed in the above ticket.
When using defer(1) with the patch listed in that ticket, the first call to respondToReadyState has the readyState argument set to something random. I've seen 27, 17, 22, 24, 1269 etc etc. This usually isn't a problem until the random number chosen is 4. When that happens the request thinks it is complete even though this.transport.readyState is still 1, and FF throws the NS_ERROR_NOT_AVAILABLE exception when reading the status.
Changing this line back to the setTimeout version and printing out the passed in readyState along with the this.transport.readyState shows they stay in sync, and the passed in readyState is 1 on the first invocation, and not some random number.
Is this the same 'memory leak'? Or corruption of memory? Buffer overflow? Why is this readyState a random number?
As a related question, why is this even a parameter? Why can we not depend on the transport for the current readyState?
Comments and changes to this ticket
-

Comron Sattari June 25th, 2008 @ 08:26 PM
Also, this seems to be the only call to defer with an argument being passed to the deferred function.
-

Stephen Weiss June 27th, 2008 @ 01:00 AM
I've seen this as well, but I worry it's not just in Firefox but also in IE and Safari. I discovered while tracking down a bug in an Ext TreePanel that happened in every browser. I just got down posting it all over the place trying to find someone else who did it (finally googled the right thing to get here...)
http://extjs.com/forum/showthrea... (the original bug I found)
http://groups.google.com/group/r... (a follow up once I realized what was really happening)
-
John-David Dalton June 27th, 2008 @ 04:23 PM
Can you try it with the attached version of Prototype (its from my fork)
-

Comron Sattari June 27th, 2008 @ 07:14 PM
John,
The version you uploaded doesn't solve the problem. I don't think if any patch that doesn't change defer or delay will help this problem. I am almost certain it has something to do with those methods and not really the Ajax stuff.
Comron
-
John-David Dalton June 27th, 2008 @ 07:20 PM
Ok I was seeing if maybe the git core version would work.... hmm alright back to the drawing board :)
-
Tobie Langel August 2nd, 2008 @ 03:31 AM
- → State changed from new to bug
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
The Prototype JavaScript library.
