[TIMOB-24615] Windows -HTTPClient - responseText is not cleared between two requests
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-05-03T01:49:04.000+0000 |
Affected Version/s | Release 6.0.4 |
Fix Version/s | Release 6.1.0 |
Components | Windows |
Labels | httpclient, responseText, windows |
Reporter | JSubramanian |
Assignee | Kota Iguchi |
Created | 2017-04-19T09:48:27.000+0000 |
Updated | 2017-05-05T19:05:58.000+0000 |
Description
I use the HTTPClient to do a service request.
Doing simultaneous http request , the responseText holds values of the first request.
As a result the values gets duplicated.
Below is the code.
var count =0;
var client = Ti.Network.createHTTPClient();
client.onerror = function(e){
};
client.onload = function(e){
count = count + 1;
console.log("Server executed " + count + " time(s)");
console.log(client.responseText);
if(count != 2){
client.open("GET", "https://httpbin.org/get");
client.send();
}
};
client.setTimeout(60000);
client.validatesSecureCertificate = false;
client.open("GET", "https://httpbin.org/get");
client.send();
The response of the above as below
----
[INFO] : Server executed 1 time(s)
[INFO] : {
[INFO] : "args": {},
[INFO] : "headers": {
[INFO] : "Accept-Encoding": "gzip, deflate",
[INFO] : "Connection": "close",
[INFO] : "Host": "httpbin.org",
[INFO] : "User-Agent": "Appcelerator Titanium/6.0.3.GA (Microsoft Virtual/6.3.9651.0; windowsphone; English_United States.1252;)",
[INFO] : "X-Titanium-Id": "49c36bc6-4470-4689-9111-a81411c54643"
[INFO] : },
[INFO] : "origin": "182.75.8.94",
[INFO] : "url": "https://httpbin.org/get"
[INFO] : }
[INFO] : Server executed 2 time(s)
[INFO] : {
[INFO] : "args": {},
[INFO] : "headers": {
[INFO] : "Accept-Encoding": "gzip, deflate",
[INFO] : "Connection": "close",
[INFO] : "Host": "httpbin.org",
[INFO] : "User-Agent": "Appcelerator Titanium/6.0.3.GA (Microsoft Virtual/6.3.9651.0; windowsphone; English_United States.1252;)",
[INFO] : "X-Titanium-Id": "49c36bc6-4470-4689-9111-a81411c54643"
[INFO] : },
[INFO] : "origin": "182.75.8.94",
[INFO] : "url": "https://httpbin.org/get"
[INFO] : }
[INFO] : {
[INFO] : "args": {},
[INFO] : "headers": {
[INFO] : "Accept-Encoding": "gzip, deflate",
[INFO] : "Connection": "close",
[INFO] : "Host": "httpbin.org",
[INFO] : "User-Agent": "Appcelerator Titanium/6.0.3.GA (Microsoft Virtual/6.3.9651.0; windowsphone; English_United States.1252;)",
[INFO] : "X-Titanium-Id": "49c36bc6-4470-4689-9111-a81411c54643"
[INFO] : },
[INFO] : "origin": "182.75.8.94",
[INFO] : "url": "https://httpbin.org/get"
[INFO] : }
Please let me know if you need more information.
[~sdarda] Hey, I Can verify that duplicated values are being returned.
Hey [~sdarda], the environment details are listed below and I ran the test case above using
appc ti build -p windows -T ws-local
in the CLI. *Environment*https://github.com/appcelerator/titanium_mobile_windows/pull/985
Verified fix in 6.2.0.v20170505081953 and 6.1.0.v20170504175418 Test and other information can be found at: 6_1_X: https://github.com/appcelerator/titanium_mobile_windows/pull/986 Master:https://github.com/appcelerator/titanium_mobile_windows/pull/985