[AC-740] createHTTPClient Fails with SDK 3.3.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2014-12-20T01:04:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | TCSupportTriage |
Reporter | James Childs |
Assignee | Mauro Parra-Miranda |
Created | 2014-08-31T16:17:23.000+0000 |
Updated | 2016-03-08T07:37:00.000+0000 |
Description
When executing an https all in 3.3.0 the httpClient returns the following error "The network connection was lost." The exact same code works with Titanium SDK 3.2.2 and earlier. Here is the output from a simple code test.
[INFO] : 2014-08-31 12:14:40.238 testimage[22981:3903] [ERROR] A SQLite database error occurred on database '/Users/me/Library/Application Support/iPhone Simulator/7.1/Applications/1DB9D52D-F780-4E99-9A35-3D3519BBA396/Library/Application Support/analytics/analytics.db': Error Domain=com.plausiblelabs.pldatabase Code=3 "An error occured parsing the provided SQL statement." UserInfo=0xcd38cd0 {com.plausiblelabs.pldatabase.error.vendor.code=1, NSLocalizedDescription=An error occured parsing the provided SQL statement., com.plausiblelabs.pldatabase.error.query.string=SELECT data FROM pending_events ORDER BY ID DESC, com.plausiblelabs.pldatabase.error.vendor.string=no such column: ID} (SQLite #1: no such column: ID) (query: 'SELECT data FROM pending_events ORDER BY ID DESC')
[INFO] : There was an error
[INFO] : {"type":"error","source":{"method":"GET","timeout":15000,"url":"https://www.mydomain.com/test.php"},"code":-1005,"error":"The network connection was lost.","success":false}
Hi, Can you provide us your test case please, that will be helpful to address your problem. Regards, Shuo
Hello, We have tested this issue. But we can not reproduce this issue as a bug, createHttpCient request works as expected on a sample test case.
Testing Environment:
Titanium SDK: 3.3.0.GA Titanium CLI: 3.3.0, Android SDK: 4.2.2,4.4.2 iOS: 7.1, OS X Version: 10.9.4, Appcelerator Studio: 3.3.0Steps to Test:
1. Create classic project. 3. Paste this file in app.js file. 3. Run this code with the testing environment.Test Case
Thanks.
Here is a sample ApplicationWindow program. function ApplicationWindow() { //create component instance var self = Ti.UI.createWindow({ backgroundColor:'#ffffff' }); callparams = { 'function': 'connection_test', type: 'json' }; var lbl = Titanium.UI.createLabel({ width:200, height:Titanium.UI.SIZE, color:'#ffffff',backgroundColor:'#000', text:'testing' }); self.add(lbl); var xhr = Titanium.Network.createHTTPClient({ timeout:15000, onerror: function(e){ Ti.API.info('There was an error'); Ti.API.info(JSON.stringify(e)); if (Titanium.Network.online) { lbl.text = this.text; } else { lbl.text = 'No network connectivity'; } }, onload:function(){ Ti.API.info('Results: '+this.responseText); lbl.text = this.responseText; } }); xhr.open("GET","https://www.leverageapplications.com/mu/services/estep_app.php"); xhr.send(callparams); return self; } //make constructor function the public component interface module.exports = ApplicationWindow;