{ "id": "133374", "key": "TIMOB-17432", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2014-09-05T18:06:39.000+0000", "created": "2014-07-18T15:55:55.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SDK3.3.0" ], "versions": [], "issuelinks": [ { "id": "40879", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "136134", "key": "TIMOB-17625", "fields": { "summary": "iOS: HttpClient with async as false not responding", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-20T22:25:07.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "It's seems to HTTPClient.open doesn't work when set async = false.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor:'white'});\r\n\r\nvar button1 = Ti.UI.createButton({\r\n title:'GET async=false',\r\n top:'15%',\r\n});\r\n \r\nvar button2 = Ti.UI.createButton({\r\n title:'GET async=true',\r\n top:'30%',\r\n});\r\n \r\n \r\nbutton1.addEventListener('click', function () {\r\n\r\n this.title = 'sending...';\r\n\r\n\tvar onload = function(e) {\r\n\t\tTi.API.debug('onload responseText='+this.responseText);\r\n\t\tbutton1.title = 'onload'; \r\n\t};\r\n\r\n\tvar onerror = function(e) {\r\n\t\tbutton1.title = 'onerror'; \r\n\t};\r\n\r\n\tvar _xhr = Ti.Network.createHTTPClient({\r\n\t\tonload: onload,\r\n\t\tonerror: onerror,\r\n\t\tcache: false\r\n\t});\r\n\r\n\tvar url = 'http://ip.jsontest.com/';\r\n\t_xhr.open('GET', url, false);\r\n\t_xhr.timeout = 5000;\r\n\t_xhr.send();\r\n\r\n});\r\n\r\nbutton2.addEventListener('click', function () {\r\n\r\n this.title = 'sending...';\r\n\r\n\tvar onload = function(e) {\r\n\t\tTi.API.info(String.format('onload e = %s', e||{}));\r\n\t\tTi.API.debug('onload responseText='+this.responseText);\r\n\t\tbutton2.title = 'onload'; \r\n\t};\r\n\r\n\tvar onerror = function(e) {\r\n\t\tTi.API.error(String.format('error e = %s', e||{}));\r\n\t\tbutton2.title = 'onerror'; \r\n\t};\r\n\r\n\tvar _xhr = Ti.Network.createHTTPClient({\r\n\t\tonload: onload,\r\n\t\tonerror: onerror,\r\n\t\tcache: false\r\n\t});\r\n\r\n\tvar url = 'http://ip.jsontest.com/';\r\n\r\n\tTi.API.debug('url = '+url);\r\n\t_xhr.open('GET', url, true);\r\n\t_xhr.timeout = 5000;\r\n\t_xhr.send();\r\n\r\n});\r\n\r\nwin.add( button1 );\r\nwin.add( button2 );\r\n\r\nwin.open(); \r\n{code}\r\n\r\nExpected Result : when tap both button1 and button2 text should change to \"onload\" or \"onerror\".\r\n\r\nActual Result: only button2 works. button1 text stays \"sending...\"\r\n", "attachment": [], "flagged": false, "summary": "iOS: HTTPClient not fire onload onerror when set option async false", "creator": { "name": "hntn", "key": "hntn", "displayName": "Tadatoshi Hanazaki", "active": true, "timeZone": "Asia/Tokyo" }, "subtasks": [], "reporter": { "name": "hntn", "key": "hntn", "displayName": "Tadatoshi Hanazaki", "active": true, "timeZone": "Asia/Tokyo" }, "environment": "CLI version 3.3.0, Titanium SDK version 3.3.0.GA\r\nMac OS X Version 10.9.4\r\nNode.js Version 0.10.13\r\n", "comment": { "comments": [ { "id": "316370", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Hi,\r\n\r\nTested with your code. Can reproduce your problem on SDK 3.3.0.GA. But It works well in SDK 3.2.3GA. I will forward this ticket to our engineer team to get this fixed. Thanks\r\n\r\nRegards,\r\nShuo", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-07-31T00:55:05.000+0000", "updated": "2014-07-31T01:40:18.000+0000" }, { "id": "322087", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-09-05T18:06:39.000+0000", "updated": "2014-09-05T18:06:39.000+0000" }, { "id": "414106", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-20T22:25:07.000+0000", "updated": "2017-03-20T22:25:07.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }