{ "id": "131058", "key": "TIMOB-17047", "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": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2014-05-30T22:09:06.000+0000", "created": "2014-05-30T05:52:40.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-3.3.0", "regression" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "issuelinks": [], "assignee": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T20:32:54.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": "HTTPClient callbacks are not triggered when HTTPClient synchronous requests. Following callbacks are tested and not triggered in SDK 3.3.0.v20140528144113. \r\nCallbacks\r\n1. onload\r\n2. onerror\r\n3. onreadystatechange\r\n4. onsendstream\r\n\r\nIt's a *regression* since it doesn't happen in 3.2.3 GA. \r\n\r\n*Steps to reproduce:*\r\n 1. Run the application with the code below.\r\n 2. Check the alert dialogs from the callbacks.\r\n\r\n*Actual Result:* Alert box are not showing for any callbacks for the synchronous requests. It works for asynchronous requests.\r\n\r\n*Expected Result:* callbacks should work for both synchronous and asynchronous requests.\r\n\r\n{code}\r\nvar win = Titanium.UI.createWindow({title:'Charset Test window', backgroundColor : 'white'});\r\n\r\nvar button = Titanium.UI.createButton({title:'OnError Check'});\r\n\r\nbutton.addEventListener('click', function() \r\n{\r\n\tvar valid_url = 'http://www.google.com';\r\n\tvar invalid_url = 'http://www.somethingxx.com';\r\n\t\r\n\tvar xhr = Ti.Network.createHTTPClient();\r\n\t\r\n\txhr.onload = function() {\r\n\t\talert('onload');\r\n\t};\r\n\t\r\n\txhr.onerror = function() {\r\n\t\talert('onerror');\r\n\t};\r\n\txhr.onreadystatechange = function() {\r\n\t\talert('statechanged');\r\n\t};\r\n\txhr.onsendstream = function() {\r\n\t\talert('sendstream');\r\n\t};\r\n\t\r\n\txhr.open('GET',valid_url,false);\r\n // Uncomment this to check the onerror callback\r\n //xhr.open('GET',invalid_url,false);\r\n\txhr.send();\r\n});\r\n\r\nwin.add(button);\r\nwin.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: HTTPClient callbacks are not triggered for synchronous request", "creator": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "subtasks": [], "reporter": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "environment": "|| Component || Version ||\r\n| Appcelerator Studio | 3.3.0.201405271647 |\r\n| Titanium SDK | 3.3.0.v20140528144113 |\r\n| Node | 0.10.28 |\r\n| acs | 1.0.14 |\r\n| alloy | 1.4.0-beta |\r\n| npm | 1.4.9 | \r\n| CLI | 3.3.0-beta |\r\n| Titanium-code-processor | 1.1.1 |\r\n| OS | OSX 10.9.3 |\r\n| Xcode | 5.1.1 |\r\n| Device | iPhone 5S (iOS 7.1) |", "closedSprints": [ { "id": 105, "state": "closed", "name": "2014 Sprint 11 SDK", "startDate": "2014-05-27T21:43:32.338Z", "endDate": "2014-06-07T00:00:00.000Z", "completeDate": "2014-06-09T21:36:37.587Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "306984", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "cc [~mlangston]", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-30T10:38:01.000+0000", "updated": "2014-05-30T10:38:01.000+0000" }, { "id": "306988", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This is a synchronous requests and works as intended. You can get the response properties after making the call. The limitation to this, an Apple NSURLRequest limitation, is that we can't get the progress of the request (onsendstream and ondatastream)\r\n{code}\r\nvar win = Titanium.UI.createWindow({title:'Charset Test window', backgroundColor : 'white'});\r\nvar button = Titanium.UI.createButton({title:'OnError Check'});\r\nbutton.addEventListener('click', function() {\r\n\tvar valid_url = 'http://www.google.com';\r\n\tvar invalid_url = 'http://www.somethingxx.com';\t\r\n\tvar xhr = Ti.Network.createHTTPClient();\r\n\txhr.open('GET',valid_url,false);\r\n\txhr.send();\r\n\r\n // get error if any:\r\n Ti.API.info( xhr.error );\r\n\r\n // get response text or data\r\n Ti.API.info( xhr.responseText );\r\n Ti.API.info( xhr.responseData );\r\n\r\n});\r\n\r\nwin.add(button);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-05-30T11:03:56.000+0000", "updated": "2014-05-30T11:09:36.000+0000" }, { "id": "307010", "author": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "body": "{code} Ti.API.info(xhr.error ) {code} prints *undefined* for both synchronous and asynchronous type of requests. \r\nBut if you place some statements inside the callback like this\r\n{code}\r\nxhr.onerror = function()\r\n{\r\n\talert('onerror is triggered');\r\n};\r\n{code}\r\nIt's not executed for synchronous type requests with the test environment mentioned in description section.", "updateAuthor": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2014-05-30T15:23:48.000+0000", "updated": "2014-05-30T15:23:48.000+0000" }, { "id": "307038", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm comfortable with marking this as \"Won't Fix\". [~bhatfield], can we please make sure this is WELL documented?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-30T18:20:13.000+0000", "updated": "2014-05-30T18:20:13.000+0000" }, { "id": "414886", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue will not fix and with reference to the above comments. ", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T20:32:54.000+0000", "updated": "2017-03-22T20:32:54.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }