Hi team,
Pinged this in IRC just now, but wanted to put it here too (where folks might see it).
The XHR 'loadend' event that's causing the SC.Request tests to timeout is basically a convenience method for 'load', 'error' and 'abort' – it fires after the XHR finishes its business, no matter how it ends up. It's all part of XHR2.
There are a small number of browsers – phantomjs included, whee – which support load, error and abort, but don't support loadend. There's actually some conversation on the webkit bug boards where one of the developers is like "who the hell needs loadend, it's just a convenience method".
In the case that loadend isn't supported, and the developer calls SC.Request#notify('loadend', ...) to attach a handler for it, should we automatically polyfill that handler out to 'load', 'error' and 'abort'? The only downsides that I can think of are some odd order of execution bug where they've specified a 'load' handler that they expect to fire before the 'loadend' one; that's no longer guaranteed... and in the handler, evt.type will show the polyfilled event type rather than the expected loadend type. So effectively we'd be replacing a rare, weird bug with a couple of weirder, but much rarer bugs.
Thoughts?
Thanks,
Dave