Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11758] Android: HTTPClient: the payload for the callbacks ondatastream and onsendstream is incorrectly set on Rhino

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-11-16T11:09:12.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Release 3.1.0, 2012 Sprint 23 API, 2012 Sprint 23
ComponentsAndroid
Labelsregression
ReporterPing Wang
AssigneePing Wang
Created2012-11-14T00:01:51.000+0000
Updated2012-12-05T17:52:53.000+0000

Description

This is a regression. This does not happen on 2.1.3.GA. Failed case 1:
var xhr = Titanium.Network.createHTTPClient();

xhr.onreadystatechange = function(e) {
	Ti.API.info("************************** xhr.onreadystatechange: this.readyState = " + this.readyState);
}

xhr.ondatastream = function(e) {
	Ti.API.info("^^^^^^^^^^^^^^^^^^^^^^^^^^ xhr.ondatastream = " + e.progress);
}

xhr.open('GET','http://www.appcelerator.com/assets/The_iPad_App_Wave.pdf');
xhr.send();

Failed case 2:
var xhr = Titanium.Network.createHTTPClient();

xhr.onreadystatechange = function(e) {
	Ti.API.info("************************** xhr.onreadystatechange: this.readyState = " + this.readyState);
}

xhr.onsendstream = function(e) {
	Ti.API.info("-------------------------- xhr.onsendstream = " + e.progress);
}

xhr.open('POST', 'https://twitpic.com/api/uploadAndPost');

var buffer = Ti.createBuffer({
	length : 1024 * 10
}).toBlob();

xhr.send({
	data : buffer,
	username : 'fgsandford1000',
	password : 'sanford1000',
	message : 'check me out'
});
Actual result: The log shows:
I/TiAPI   (11891): ^^^^^^^^^^^^^^^^^^^^^^^^^^ xhr.ondatastream = undefined
or
I/TiAPI   (11891): -------------------------- xhr.onsendstream = undefined
Expected result: The log shows the numerical progress for datastream / sendstream.

Comments

  1. Ping Wang 2012-11-15

    This regression is caused by [PR #2687](https://github.com/appcelerator/titanium_mobile/pull/2687) .
  2. Ping Wang 2012-11-15

    PR https://github.com/appcelerator/titanium_mobile/pull/3430 Steps for FR: 1. Run the above two test cases on both rhino and v8. Should see the value of e.progress in the log. 2. Run Anvil -> network_httpclient on both rhino and v8. All the tests (including callbackTestForGETMethod and callbackTestForPOSTMethod) should pass.
  3. Ping Wang 2012-11-27

    3_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/3474
  4. Bill Dawson 2012-11-28

    Bill is reviewing the 3_0_X PR.
  5. Natalie Huynh 2012-12-05

    Tested with 3.0.0.20121204144658 on Droid 1 2.2.3 with Rhino

JSON Source