#189 bug
Comron Sattari

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

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

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.

Shared Ticket Bins

People watching this ticket

Referenced by

Pages