Opened 12 years ago

Closed 11 years ago

#5734 closed defect (worksforme)

Intermittent xhrPost failure

Reported by: jeffg Owned by: James Burke
Priority: high Milestone: 1.2
Component: Core Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by alex)

I'm testing my code under a variety of browsers including Safari 3 (windows). The same xhrPost code seems to work reliably on all but Safari. I occasionally see the xhrPost get an error response and the status is zero. (tk has also seen this but on FF under OSX). The server is not sent anything.

Is this a bug or an expected condition that requires the client to retry again when it occurs? (yikes!)

The relevant code snippet goes something like this:

    <script type="text/javascript"
        src="<?=$docURL?>/dojo.x/dojo/dojo.js"
        djConfig="parseOnLoad: true, usePlainJson: true"></script>
...

dojo.xhrPost( {
    url: _urlAjax,
    content: {'ver' : 1, 'func': 'poll', 'args':jsonStr },
    handleAs: "json", 
    timeout: g_timeout, // Time in milliseconds
    handle: function(response, ioArgs){
        if( response instanceof Error && ioArgs.xhr.status === 0 )
            console.debug( "WTF?");
        else console.debug( "normal");
      }

Attachments (2)

xhrInterval.html (977 bytes) - added by James Burke 11 years ago.
Test file, place in dojo/tests/_base directory.
xhrInterval.php (53 bytes) - added by James Burke 11 years ago.
PHP endpoint for test file. Also place in dojo/tests/_base

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 years ago by dylan

Milestone: 1.1
Owner: changed from anonymous to dante

comment:2 Changed 12 years ago by dante

Milestone: 1.11.2

jeffg: could i bribe you into make a test case that calls an xhrPost over and over and over looking for the failing condition?

comment:3 in reply to:  2 Changed 12 years ago by guest

Replying to dante:

jeffg: could i bribe you into make a test case that calls an xhrPost over and over and over looking for the failing condition?

I could use the money...

I can see that it is getting the the error in xhr.js line 581 (Unable to load" with status =0, if that helps.

It's just a loop via setTimeout of an xhrPost doing an ajax request... tk also has this issue. It shows up more on webkit than on FF... If get a chance to create aample I will..., else...

comment:4 Changed 12 years ago by alex

Description: modified (diff)
Owner: changed from dante to alex
Status: newassigned

comment:5 Changed 11 years ago by James Burke

Owner: changed from alex to James Burke
Status: assignednew

Changed 11 years ago by James Burke

Attachment: xhrInterval.html added

Test file, place in dojo/tests/_base directory.

Changed 11 years ago by James Burke

Attachment: xhrInterval.php added

PHP endpoint for test file. Also place in dojo/tests/_base

comment:6 Changed 11 years ago by James Burke

Resolution: worksforme
Status: newclosed

I just attached an xhrInterval.html and xhrInterval.php test file. I have run it for about 5 minutes with Firefox 3.0.1 and Safari 3.1.2 on OS X, and I do not see the error condition.

Both browsers were revved since this report, so maybe something got magically fixed? Closing this as unreproducible, but feel free to modify the test case and reopen if a reproducible error can be found.

Note: See TracTickets for help on using tickets.