Bug Tracker

Opened 13 years ago

Closed 12 years ago

#6640 closed bug (invalid)

complete() called twice in error condition

Reported by: noel_bush Owned by:
Priority: undecided Milestone: 1.4.3
Component: ajax Version: 1.4.2
Keywords: xhr complete Cc:
Blocked by: Blocking:


In $.ajax(), line 5251 starts a try/catch that calls send() on the xhr. As part of the send operation, the onreadystatechange() function is called (line 5163), and in some circumstances, complete() is called (line 5214). One of these circumstances is when the server is not available. An XMLHttpRequestException with code 101 / name NETWORK_ERR is thrown, and caught by the catch clause (line 5253), which then calls complete() again.

The documentation doesn't mention that complete() might be called twice.

(All line numbers are from the (non-compressed) v1.4.2.)

Change History (1)

comment:1 Changed 12 years ago by addyosmani

Keywords: xhr complete added
need: ReviewTest Case
Priority: undecided
Resolution: invalid
Status: newclosed

Although I've taken a look into lines 5251, 5214 and 5253, would you be able to supply us with a complete test case showing where complete() is being called twice? That would allow us to investigate further without guessing the change in behaviour that would solve the issue.

Please re-submit your ticket once this is available and we'll look at it again.


Note: See TracTickets for help on using tickets.