{ "id": "148392", "key": "TIMOB-18971", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-07-12T07:47:13.000+0000", "created": "2015-06-01T21:09:18.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "httpclient", "qe-4.0.1" ], "versions": [ { "id": "16878", "description": "Release 4.0.1", "name": "Release 4.0.1", "archived": false, "released": true, "releaseDate": "2017-02-06" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2016-07-12T07:47:20.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": "*Details:* If you make a valid DELETE REST call, then HTTPClient's onload method is not called.\r\n\r\n*Notes:*\r\n* This issue is not reproducible on Android\r\n* Even though the onload method is not being called, the DELETE request still goes through\r\n* Other Http REST calls (e.g. POST) are triggering HTTPClient's onload method\r\n\r\n*Steps to reproduce:*\r\n# Create a Titanium *and* Arrow project from Appc Studio\r\n# In the Titanium project, replace the app.js with the attached app.js\r\n# Next, select the Arrow project and run *Local Arrow Server*\r\n# In the console, copy the port number after {{http://127.0.0.1:}}\r\n# In the Titanium project's app.js, replace {{URL_PREFIX}} (line 2) with your machine's ip address and Arrow project's port number e.g. {{http://172.16.3.129:62756}}\r\n# In the same app.js file, replace {{API_KEY}} (line 8) with your Arrow project's {{apikey_development}}; /conf/default.js\r\n# Next, install your Titanium project to an iOS device; make sure the device is on the same wifi network as your machine\r\n# Open the app and press {{1. Create}}; wait for *CREATED MONKEY LORD* alert\r\n# Next, press {{2. DELETE}}\r\n\r\n*Actual:* The onload method is never called i.e. *DATA DELETED* alert is never triggered in the onload method.\r\n\r\n*Expected:* The onload method should be called if a valid DELETE Http REST called is made.", "attachment": [ { "id": "55684", "filename": "app.js", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-06-01T20:53:32.000+0000", "size": 1896, "mimeType": "text/javascript" } ], "flagged": false, "summary": "iOS: HTTPClient - If you make a DELETE REST call, then HTTPClient's onload method is not called", "creator": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Appcelerator Studio, build: 4.0.1.201505282200\r\nAppc CLI NPM: 4.0.0\r\nAppc CLI Core: 4.0.1\r\nSDK: 4.0.1.v20150529150210\r\nXcode: 6.3.2\r\nDevice: iphone 5 (8.1)\r\nNode: v0.10.36\r\nOS: Yosemite (10.10.3)", "comment": { "comments": [ { "id": "354134", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Not currently scheduling this for a release, but let me know if you feel otherwise.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-02T18:55:31.000+0000", "updated": "2015-06-02T18:55:31.000+0000" }, { "id": "390459", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Closing issue for now. I tested the requests using an open REST testing-service:\r\n{code:javascript}\r\n// specify the arrow api endpoint\r\nvar URL_PATH = 'http://jsonplaceholder.typicode.com';\r\n\r\nfunction makeRequest(path, verb, onLoad, data) {\r\n var xhr = Ti.Network.createHTTPClient({\r\n onload: onLoad,\r\n onerror: function() {\r\n Ti.API.error('Error ' + verb + ': ' + this.status + '; ' + this.responseText);\r\n }\r\n });\r\n \r\n xhr.open(verb, URL_PATH + path); \r\n \r\n if(data) {\r\n xhr.setRequestHeader(\"Content-Type\",\"application/json\");\r\n xhr.send(JSON.stringify(data)); \r\n }\r\n else {\r\n xhr.send();\r\n }\r\n}\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white',\r\n layout: 'vertical'\r\n});\r\n\r\nvar postButton = Ti.UI.createButton({\r\n title: '1. Create',\r\n top: '30%'\r\n});\r\nwin.add(postButton);\r\npostButton.addEventListener('click', function(e) {\r\n \r\n Ti.API.info('####: POST a monkey');\r\n \r\n var data = {\r\n first_name: 'MONKEY',\r\n last_name: 'LORD',\r\n email: 'monkey@lord.com' \r\n };\r\n makeRequest('/posts', 'POST', function(_e) {\r\n\t\tTi.API.warn(this.status);\r\n if(this.status === 201) {\r\n alert('CREATED MONKEY LORD');\r\n }\r\n }, data);\r\n});\r\n\r\nvar deleteButton = Ti.UI.createButton({\r\n title: '2. DELETE',\r\n top: '20dp'\r\n});\r\nwin.add(deleteButton);\r\ndeleteButton.addEventListener('click', function(e) {\r\n makeRequest('/posts/1', 'DELETE', function(_e) {\r\n \r\n Ti.API.info('####: DELETE calling onload');\r\n\t\tTi.API.warn(this.status);\r\n \r\n if(this.status === 200) {\r\n alert('DATA DELETED');\r\n }\r\n });\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\nThe onLoad is triggered and the response is 200 (not 204, because there is response). Please validate to make sure you see the same. I would suspect that something was wrong on the arrow-side.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-07-12T07:46:50.000+0000", "updated": "2016-07-12T07:46:50.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }