Jacob MaineJacob Maine
SF Standup 3/4-3/5/2010
edit Posted by Jacob Maine on Friday March 05, 2010 at 09:25AM

Help

"What's the best way to test that an array contains another array?"

A custom matcher using array - other_array was suggested.

Interesting

The team that was having problems with Prototype response codes found a partial solution.

They sometimes call abort() on the request which triggers the callbacks with a 0 response code. They found that if they set transport.onreadystatechange = function() {}; before calling abort() they could skip the callbacks, and manually call whatever clean-up they needed. That Prototype interprets 0 as a success still sounds strange.

Jacob MaineJacob Maine
SF Standup 3/3/2010: Disappearing response codes
edit Posted by Jacob Maine on Wednesday March 03, 2010 at 09:23AM

A Palm project uses Prototype for their ajax calls. They noticed that Prototype casts low-level errors (network errors, etc.) to a response code of 0. Unfortunately, the rest of Prototype interprets 0 as "success". When they hacked Prototype to interpret 0 as a failure, another darker problem emerged. In some cases, for example if they send two requests in rapid succession, even if both responses have 200 in their headers, Prototype will report the second's response code as 0. So, 0 can indicate success or failure in different scenarios.