WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
27790
XMLHTTPRequest Status Code 0 Bug
https://bugs.webkit.org/show_bug.cgi?id=27790
Summary
XMLHTTPRequest Status Code 0 Bug
Steve
Reported
2009-07-28 18:36:57 PDT
In the past, we had used both FireFox 1 and 2 for years as our default browser for our web-based business system that we wrote in-house. When trying to upgrade to use SAFARI 4, we started getting all kinds of XMLHTTPRequest errors, and it's an issue with the status code returning 0 and the xmlhttprequest actually failing to send data. (Firefox 3 does the same thing as Safari 4, and I posted a bug on mozilla, but there's been no feedback for months) I've put an exagerated example up on the following link
http://homepage.mac.com/zacware/firefox_bug/firefox_bug.htm
In the real world, our system refreshes page elements via ajax calls when a window is brought to the foreground. Also sometimes elements are refreshed periodically. If a window is closed while this is happening for example, it will cause a similar condition. NOTE: JQuery and Prototype also have the same problem. The code I included was simply so the file could run without any external libraries being needed
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2009-07-29 18:00:02 PDT
This test overwrites myXMLRequestInstance variable when making subsequent requests. E.g., when request #1 finishes, the code in ProcessAjaxCall may be looking at XMLHttpRequest object for request #14 already. Ready state 4 and status 0 is normal for requests that are aborted (and the test aborts requests after 500 ms). In short, the fix is to replace "myXMLRequestInstance" with "target" in ProcessAjaxCall().
Steve
Comment 2
2009-08-10 21:11:15 PDT
I believe that your opinion that this is not actually a bug is incorrect. jQuery and Prototype's ajax functions also experience the exact same issue I've described in this bug report. I merely used my code to have something that ran self-contained. And the code I used has a javascript closure in it that should avoid the issue you pointed out. Regardless of that however, I just went back and tried again with the very latest copy of both prototype and jquery and this bug still exists. If an ajax request created via jquery or prototype is in progress, and you reload the page at the same time, Safari will cause the error handler to fire in both libraries.
Alexey Proskuryakov
Comment 3
2009-08-10 21:34:38 PDT
> And the code I used has a javascript closure in it that should avoid the issue > you pointed out.
You don't get a new closure each time you call a function, no.
> If an ajax request created via jquery or prototype is in progress, and you > reload the page at the same time, Safari will cause the error handler to fire > in both libraries.
This sounds like something different than reported originally. The linked test doesn't even have an error event handler. Please clarify what exactly you report as a bug. If it's something different than reported originally, it's best to resolve this issue as INVALID and file a new one to avoid further confusion.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug