Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24615] Windows -HTTPClient - responseText is not cleared between two requests

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-05-03T01:49:04.000+0000
Affected Version/sRelease 6.0.4
Fix Version/sRelease 6.1.0
ComponentsWindows
Labelshttpclient, responseText, windows
ReporterJSubramanian
AssigneeKota Iguchi
Created2017-04-19T09:48:27.000+0000
Updated2017-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.

Comments

  1. Samir Mohammed 2017-04-20

    [~sdarda] Hey, I Can verify that duplicated values are being returned.
  2. Samir Mohammed 2017-04-21

    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*
       APPC CLI: 6.2.0
       SDK Version = 6.0.3.GA
       Operating System:
       Name = Microsoft Windows 10 Pro
       Version = 10.0.14393
       Architecture = 32bit
       CPUs = 4
       Memory = 17034395648
       Node.js:
       Node.js Version = 6.10.1
       
  3. Kota Iguchi 2017-05-02

    https://github.com/appcelerator/titanium_mobile_windows/pull/985
  4. Samir Mohammed 2017-05-05

    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

JSON Source