{ "id": "167985", "key": "TIMOB-24748", "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": "19572", "description": "Important fixes for 6.1.0", "name": "Release 6.1.1", "archived": false, "released": true, "releaseDate": "2017-06-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-06-07T00:43:16.000+0000", "created": "2017-05-30T15:04:38.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "merge-6.1.1", "regression" ], "versions": [ { "id": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "issuelinks": [ { "id": "58847", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "175683", "key": "TIMOB-28214", "fields": { "summary": "Android: Remove dead \"TiAuthenticator\" Java code to avoid security warnings", "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": "Medium", "id": "3" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-10-29T21:42:41.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": [], "description": "*Problem*\r\nApparently HTTP streaming can't be set when authentication is used. The retry mechanism of the basic authentication throws a {{HttpRetryException}} when the request body is streamed.\r\n\r\n*Test case*\r\n_Provided by Jorge Macias in Slack_\r\n\r\n\r\n{code:java}\r\nvar window = Ti.UI.createWindow();\r\nvar button1 = Ti.UI.createButton({title:\"Basic request\", top: 30});\r\nwindow.add(button1);\r\n\r\nbutton1.addEventListener('click', prepareRequest);\r\n\r\nfunction prepareRequest(e) {\r\n request(true);\r\n}\r\n\r\n/**\r\n* Make a request\r\n* @method request\r\n* @param {boolean} withCredentials Flag for make a auth request or not\r\n*/\r\nfunction request(withCredentials) {\r\n var client,\r\n config,\r\n url,\r\n data;\r\n\r\n data = {\r\n message: 'This is my message'\r\n };\r\n\r\n config = {\r\n timeout: 5000\r\n };\r\n\r\n if (withCredentials) {\r\n url = 'https://srvasic.upv.es/recursos/error401.asp';\r\n //config.withCredentials = true;\r\n config.username = 'user';\r\n config.password = 'p$wd';\r\n }\r\n\r\n console.log('HTTP CLIENT CONFIG ' + JSON.stringify(config));\r\n\r\n client = Ti.Network.createHTTPClient(config);\r\n client.setOnload(success);\r\n client.setOnerror(error);\r\n\r\n try {\r\n console.log('URL: ' + url);\r\n client.open('POST', url);\r\n } catch (e) {\r\n console.log('error opening client');\r\n console.log(JSON.stringify(e));\r\n }\r\n\r\n try {\r\n client.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\r\n } catch (e) {\r\n console.log('error setting request headers');\r\n console.log(JSON.stringify(e));\r\n }\r\n\r\n try {\r\n client.send(data);\r\n } catch (e) {\r\n console.log('error sending data');\r\n console.log(JSON.stringify(e));\r\n }\r\n}\r\n\r\n/**\r\n* HttpClient Success Callback\r\n* @method success\r\n* @param {object} e Callback Event\r\n*/\r\nfunction success(e) {\r\n console.log('Success callback: ' + this.responseText);\r\n}\r\n\r\n/**\r\n* HttpClient Error Callback\r\n* @method error\r\n* @param {object} e Callback Event\r\n*/\r\nfunction error(e) {\r\n console.log('Error callback : ' + e.error);\r\n}\r\n\r\nwindow.open();\r\n{code}\r\n\r\n*Logs*\r\n\r\n{code:console}\r\nE/TiHTTPClient: (TiHttpClient-1) [53661,53661] HTTP Error (java.net.HttpRetryException): Cannot retry streamed HTTP body\r\n java.net.HttpRetryException: Cannot retry streamed HTTP body\r\n at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:417)\r\n at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501)\r\n at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)\r\n at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java)\r\n at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1224)\r\n at java.lang.Thread.run(Thread.java:818)\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: HTTPClient - can't use streaming mode with authentication", "creator": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "subtasks": [], "reporter": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "environment": "OS: Windows 10\r\nTarget platform: Android 6.0.1\r\nTitanium: 6.1.0.GA/master\r\n", "closedSprints": [ { "id": 903, "state": "closed", "name": "2017 Sprint 12 SDK", "startDate": "2017-06-05T00:15:46.290Z", "endDate": "2017-06-19T00:15:00.000Z", "completeDate": "2017-06-19T16:09:22.870Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "420776", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/9104", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2017-06-01T15:25:02.000+0000", "updated": "2017-06-01T15:25:02.000+0000" }, { "id": "421112", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with this environment:\r\nNode Version: 6.10.3\r\nNPM Version: 3.10.10\r\nMac OS: 10.12.4\r\nAppc CLI: 6.2.2\r\nAppc CLI NPM: 4.2.9\r\nTitanium SDK version: PR/9104\r\nAppcelerator Studio, build: 4.9.0.201705302345\r\nXcode 8.3.2\r\n\r\nFR Passed. After verifying the regresssion (no errors in SDK 6.0.4, but errors in SDK 6.1.0) I tested with the above testcase, and no errors were seen in the latest fix.\r\n\r\nFixes are found in:\r\n6.1.1.v20170606173149\r\n6.2.0.v20170606155020", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-06T18:37:52.000+0000", "updated": "2017-06-07T01:19:41.000+0000" }, { "id": "421129", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (6.1.X): https://github.com/appcelerator/titanium_mobile/pull/9119", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-06T21:21:31.000+0000", "updated": "2017-06-06T21:21:31.000+0000" }, { "id": "426933", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "A lot of log messages like this appear now:\r\n\r\n\r\n{noformat}\r\nD/TiHTTPClient(24488): (main) [2081,3720] Setting ready state to 1\r\nD/TiHTTPClient(24488): (TiHttpClient-34) [61,3781] Setting ready state to 2\r\nD/TiHTTPClient(24488): (TiHttpClient-34) [0,3781] Setting ready state to 3\r\nD/TiHTTPClient(24488): (TiHttpClient-34) [17,3798] Setting ready state to 4\r\nD/TiHTTPClient(24488): (main) [55,3853] Setting ready state to 1\r\n\r\n{noformat}\r\n\r\nbecause in this line: https://github.com/appcelerator/titanium_mobile/pull/9119/files#diff-1e01f142e85df58a3e89a93008e5a21eL446\r\n{{Log.DEBUG_MODE}} was removed. Was this done by intention or just for testing purpose?\r\n", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-19T13:23:32.000+0000", "updated": "2017-08-19T13:23:32.000+0000" }, { "id": "426945", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "[~michael] It was for testing purpose.", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2017-08-21T08:28:49.000+0000", "updated": "2017-08-21T08:28:49.000+0000" }, { "id": "427035", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "[~michael] For the fix:\r\nPR: https://github.com/appcelerator/titanium_mobile/pull/9342\r\n6_2_X: https://github.com/appcelerator/titanium_mobile/pull/9343\r\n", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2017-08-22T14:48:32.000+0000", "updated": "2017-08-22T14:48:32.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }