[TIMOB-2573] HttpClient drops properties while doing a callback
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:59:29.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.1 M01 |
Components | iOS |
Labels | ios, regression |
Reporter | Blain Hamon |
Assignee | Stephen Tramer |
Created | 2011-04-15T03:23:08.000+0000 |
Updated | 2011-04-17T01:59:29.000+0000 |
Description
This is actually due to a compromise in order to reduce memory issues due to recursive XHR call chains, as we intentionally jettison the request holding the internal data. This will be fixed in the great XHR refactor.
To recreate:
var xhr = Titanium.Network.createHTTPClient();
xhr.onload = function(e){
Ti.API.info('onload');
Ti.API.info(xhr.location);
// Ti.API.info(xhr.responseText);
};
xhr.onerror = function(e){
Ti.API.info('onerror');
// Ti.API.info(xhr.responseText);
};
xhr.open('GET','http://www.motorsport-total.com/f1/live/htdocs/ticker.php');
xhr.send();
Expected result:
[INFO] test/1.0 (1.5.1_9819ce0_13122010.9819ce0)
[INFO] onload
[INFO] http://www.motorsport-total.com/f1/live/htdocs/ticker.php?strecken_id=19&event_id=7&kunde=default
Actual result:
[INFO] test/1.0 (1.5.1_9819ce0_13122010.9819ce0)
[INFO] onload
[INFO] <null>
Workaround:
Use this.location and this.responseText.
Credit to Tamas Daniel for the sample code.
I would like us to also review two related tickets and discuss:
#519 #1502
~ralf
Nope, location still gets jettisoned.
this.responseText works.
is #2450 related?
Has to be part of the XHR refactor. Our canned HTTP client responses do not include location.
What do you mean it does not have "location?" Sure it does, I'm using it.
Stephen , I can confirm that the build with githash=188468e puts the location in place. Thanks.
Thank you for testing this, I had initially misidentified it as a different bug. Tested myself and confirmed the fix.
Made the 1.5.1 release. Moving to the milestone it was fixed in and marking it resolved by #2450