Status: Unconfirmed
Owner: ----
Labels: OS-Mac Area-Undefined Pri-2 Type-Bug
New issue 159827 by
jcla...@etsy.com: duplicate
XMLHttpRequest.onreadystatechange calls with 'ready' state for the same
request.
http://code.google.com/p/chromium/issues/detail?id=159827
Chrome Version : 23.0.1271.64
URLs (if applicable) :
http://jsfiddle.net/MeXvJ/
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Safari 5: ? (bug occurs on iOS 6, but is not reproducible by the means
below)
Firefox 4.x: OK
IE 7/8/9: OK
What steps will reproduce the problem?
1. Visit
http://jsfiddle.net/YJU8R/
2. If you have popup windows blocked, unblock
3. Refresh or click 'Run'
What is the expected result?
1 alert window with the message 'error' should appear
What happens instead?
3 alert windows with the message 'error' appear.
If you look at the Chrome debugger console, you will see 3 _identical_ XHR
objects.
* Note that this also reproduces if you replace 'showModalDialog()'
with 'debugger;' and run the script with the debugging console open:
http://jsfiddle.net/5f37q/
Please provide any additional information below. Attach a screenshot if
possible.
This is a behavior we've observed in the wild in Chrome, Mobile Safari, and
Mobile Chrome (both on iOS 6) -- a case where a single AJAX request
triggers multiple calls to its success method. We tracked that behavior
back to multiple calls to an XHR.onreadystatechange method -- all for the
same request, and all indicating 'READY'.
For some reason it always happens in 3's.
It's very difficult for us to reproduce this in the wild -- usually it
happens when many requests are happening simultaneously -- and even then it
only happens occasionally.
The jsfiddle above was the best we could find in terms of consistently
reproducing the issue.
Sorry I don't have more info.
P.S. -- These issues might be related:
-
http://stackoverflow.com/questions/12761255/can-xhr-trigger-onreadystatechange-multiple-times-with-readystate-done
-
https://bugs.webkit.org/show_bug.cgi?id=28878
-
https://bugs.webkit.org/show_bug.cgi?id=90160
-
http://code.google.com/p/chromium/issues/detail?id=152390 (sounds
similar, but doesn't repro for me)