Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5395] Android CLI 6.3.0 causes variables in HTTPClient to be undefined

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2017-11-29T20:54:04.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAppcelerator CLI
Labels6.2.2, android, httpclient
ReporterDavid van de Meer
AssigneeShak Hossain
Created2017-11-21T07:04:32.000+0000
Updated2017-11-30T01:32:54.000+0000

Description

When building on android with CLI 6.3.0 some variables that are defined and used inside a HTTPClient are undefined on the HTTPClient onload. In the example below you will see that the methodVar inside the onload is undefined - I am guessing its to do with the memory fixes they pushed in 6.3.0 but I am not sure... Relavent code:
// set method as data.method else CHECK
var methodVar = data.method || "checkURL";

 Ti.API.info("methodVar: " + methodVar);
    
// createHTTPClient       
var client = Ti.Network.createHTTPClient({
        onload : function(e) {												// if success do           
            Ti.API.info("methodVar: " + methodVar);
   },
        onerror : function(e) {
});
            
    // open the connection with client.open with url
    client.open('HEAD', url);
    
    // Send the request.
    client.send();      
    
};	   

Comments

  1. Mostafizur Rahman 2017-11-21

    Hello [~dieskim], Thanks for sharing with us. Can you please share a complete test case to reproduce this on our end? Best
  2. David van de Meer 2017-11-21

    What do you need for a complete test case? Do you have an example of a complete test case?
  3. Sharif AbuDarda 2017-11-21

    Hello, We need a full sample code/project that only contain the issue components and can be used for testing to verifying the issue. Thanks.
  4. David van de Meer 2017-11-30

    yes you can close, this seems to work normally now - I guess it must have been related to another bug with logs that was fixed

JSON Source