[Webkit-unassigned] [Bug 106937] New: Cannot abort multiple XHR POSTs made to same url

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 15 12:33:01 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=106937

           Summary: Cannot abort multiple XHR POSTs made to same url
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P1
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: chris.cinelli at formativelearning.com


Chrome Version       : Version 22.0.1229.92 m
URLs (if applicable) :
Other browsers tested:
 Safari 6.0.1: FAIL
  Firefox  15: OK
         IE 9: OK

What steps will reproduce the problem?
1. Make multiple XHR Post requests to the same URL
2. Note that the payload should be unique
3. Note that each XHR request is made
4. try aborting them (before they complete), note that only the last one is actually aborted

Workaround: make the url unique by adding a query string

What is the expected result?
Each XHR call should be aborted

What happens instead?
Only the last XHR call can be successfully aborted

We had problems when one of our logging server was taking longer than expected to answer. All the logging requests from the frontend were logged to the same URL. When the jQuery ajax requested timed out, the XHR was not aborted and remained pending. It did not take too long that the browser run out of connections and was not able to send any more requests. 

Code sample:

// Code sample instructions:
1) navigate to http://posttestserver.com 
       + this prevents access denied in IE testing
2) Open developer console
3) Ensure that network logging is enabled
4) Run the code below in the console
5) Note that 3 requests are made, only the last is canceled
6) Run it again, this time with workAroundOn = true
7) Note that all 3 requests are made and all three are canceled

// start code sample
var workAroundOn = false,
    baseUrl = 'http://posttestserver.com/post.php?sleep=10';

for (var requestNumber in [0,1,2]){
    (function( requestNumber  ){

    var xhr = new XMLHttpRequest()
            postUrl = baseUrl;

        // if the url is unique, everything works as expected
        if (workAroundOn){
            postUrl = postUrl + '&r=' + requestNumber;
        }

        // open the async post request
        xhr.open("POST", postUrl, true);   

        // send the request with a unique payload
        //    if the payload is not different, chrome only sends one post...
        xhr.send(requestNumber); 

    console.log('request made, requestNumber:'+requestNumber,xhr);

        // abort the call after other calls have been made
        setTimeout(function(){
            console.log('abort upload, requestNumber:'+requestNumber,xhr);
            xhr.abort();
        },2500);

    }( requestNumber ));
}



See http://code.google.com/p/chromium/issues/detail?id=154643

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list