Ticket #5734 (closed defect: worksforme)

Opened 10 months ago

Last modified 3 months ago

Intermittent xhrPost failure

Reported by: jeffg Owned by: jburke
Priority: normal Milestone: 1.2
Component: Core Version: 1.0
Severity: critical Keywords:
Cc:

Description (last modified by alex) (diff)

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

xhrInterval.html (1.0 kB) - added by jburke 3 months ago.
Test file, place in dojo/tests/_base directory.
xhrInterval.php (53 bytes) - added by jburke 3 months ago.
PHP endpoint for test file. Also place in dojo/tests/_base

Change History

  Changed 9 months ago by dylan

  • owner changed from anonymous to dante
  • milestone set to 1.1

follow-up: ↓ 3   Changed 9 months ago by dante

  • milestone changed from 1.1 to 1.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?

in reply to: ↑ 2   Changed 9 months 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...

  Changed 8 months ago by alex

  • owner changed from dante to alex
  • status changed from new to assigned
  • description modified (diff)

  Changed 4 months ago by jburke

  • owner changed from alex to jburke
  • status changed from assigned to new

Changed 3 months ago by jburke

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

Changed 3 months ago by jburke

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

  Changed 3 months ago by jburke

  • status changed from new to closed
  • resolution set to worksforme

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.