{ "id": "137623", "key": "TIMOB-19540", "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": [ { "id": "18928", "name": "Release 6.0.2", "archived": false, "released": true, "releaseDate": "2017-02-27" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-01-25T11:48:08.000+0000", "created": "2014-10-02T23:47:11.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "regression" ], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-01-25T11:48:13.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": "I took the exact code that is in the documentation for Titanium.Network.HTTPClient and it works fine as it is for all environments. I took the sample code and modified it by making the open() call synchronous ([async = false] for 3rd parameter) and it fails in SDK 3.3.0 and 3.4.0. Normally I would not use synchronous mode, however, I inherited a large project that relies on a synchronous call and it fails. The code below is the sample code with the one parameter modified. You can stick this anywhere in a simple project and you should be able to see the problem. Neither onload() or onerror() are called in SDK 3.3.0, but they are in SDK 3.2.3. I've tried on Xcode 5 and 6 and iOS 7 and 8, with the same results. It clearly seems to be a regression in SDK 3.3.0.\r\n\r\n{code:javascript}\r\n\tvar url = \"http://www.appcelerator.com\";\r\n\tvar client = Ti.Network.createHTTPClient({\r\n\t\t// function called when the response data is available\r\n\t\tonload : function(e) {\r\n\t\t\tTi.API.info(\"Received text: \" + this.responseText);\r\n\t\t\talert('success');\r\n\t\t},\r\n\t\t// function called when an error occurs, including a timeout\r\n\t\tonerror : function(e) {\r\n\t\t\tTi.API.debug(e.error);\r\n\t\t\talert('error');\r\n\t\t},\r\n\t\ttimeout : 5000 // in milliseconds\r\n\t});\r\n\t// Prepare the connection.\r\n\t\r\n\t// BUG:\r\n\t// This code is the sample code from the documentation simply added to the doClick function above.\r\n\t// The only change is to add the 3rd paramater [async] which defaults to 'true'.\r\n\t// When it is 'true', everything works fine, but when set to 'false', neither the onload() or onerror()\r\n\t// functions are called. This code works with SDK 3.2.3, but not with SDK 3.3.0 or 3.4.0.\r\n\tclient.open(\"GET\", url, false);\r\n\t// Calling with async set to true succeeds \r\n\t//client.open(\"GET\", url, true);\r\n\r\n\t// Send the request.\r\n\tclient.send();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Ti.Network.HTTPClient does not work in synchronous mode in SDK 3.3.0+", "creator": { "name": "paulking7", "key": "paulking7", "displayName": "Paul R. King", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "paulking7", "key": "paulking7", "displayName": "Paul R. King", "active": true, "timeZone": "America/New_York" }, "environment": "Mac OSX 10.9.5, Xcode 5.1 and 6.0, iOS 7.1 and 8.0, iPad Air device and Simulator", "closedSprints": [ { "id": 741, "state": "closed", "name": "2016 Sprint 22 SDK", "startDate": "2016-10-22T00:02:29.945Z", "endDate": "2016-11-05T00:02:00.000Z", "completeDate": "2016-11-07T04:38:58.335Z", "originBoardId": 114 }, { "id": 796, "state": "closed", "name": "2017 Sprint 02 SDK", "startDate": "2017-01-15T00:00:41.845Z", "endDate": "2017-01-29T00:00:00.000Z", "completeDate": "2017-01-30T21:10:44.640Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "399244", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/APSHTTPClient/pull/38\r\n\r\nWill update the SDK after the PR has been approved.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-18T14:28:31.000+0000", "updated": "2016-10-18T14:28:31.000+0000" }, { "id": "399757", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "CR and FT passed! Update SDK please :)", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-25T02:02:44.000+0000", "updated": "2016-10-25T02:02:44.000+0000" }, { "id": "399771", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (titanium_mobile/master): https://github.com/appcelerator/titanium_mobile/pull/8542", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-25T06:25:24.000+0000", "updated": "2016-10-25T06:25:24.000+0000" }, { "id": "399850", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR merged!", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-26T08:56:59.000+0000", "updated": "2016-10-26T08:56:59.000+0000" }, { "id": "401702", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix with this environment:\r\nNPM Version: 2.15.9\r\nNode Version: 4.5.0\r\nMac OS: 10.12.1\r\nAppc CLI: 6.0.0\r\nAppc CLI NPM: 4.2.8\r\nTitanium SDK version: 6.1.0.v20161121004950\r\nAppcelerator Studio, build: 4.8.0.201611121409\r\nXcode 8.1 GM\r\n\r\nI first tried the demo app on SDK 6.0.0 with iOS 10.1.1 device, and found that when the app loaded, there was no activity, and the 5000 ms timeout error did not occur. I then tried it with SDK 6.1.0, and an alert popped up with \"Success\", as expected. The bug is considered fixed.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-22T18:35:56.000+0000", "updated": "2016-11-22T18:35:56.000+0000" }, { "id": "404941", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening to add release version for back-port", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-01-20T17:13:58.000+0000", "updated": "2017-01-20T17:13:58.000+0000" }, { "id": "405059", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8768", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-23T13:24:45.000+0000", "updated": "2017-01-23T13:24:45.000+0000" }, { "id": "405093", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Validated with this environment:\r\nNPM Version: 2.15.9\r\nNode Version: 4.5.0\r\nMac OS: 10.12.1\r\nAppc CLI: 6.1.0\r\nAppc CLI NPM: 4.2.8\r\nTitanium SDK version: 6.0.2.v20170123062940\r\nAppcelerator Studio, build: 4.8.1.201612050850\r\nXcode 8.2\r\niOS Device: 10\r\n\r\nI tried the demo app on SDK 6.0.1 with iOS 10.1.1 device, and found that when the app loaded, there was no activity, and the 5000 ms timeout error did not occur (when it should have) After reproducing this bug, I then tried it with SDK 6.0.2, and an alert popped up with \"Success\", as expected.\r\n", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-01-23T19:10:22.000+0000", "updated": "2017-01-23T19:10:22.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }