{ "id": "154744", "key": "TIMOB-20367", "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": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-05-17T07:10:38.000+0000", "created": "2016-02-04T11:51:14.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android" ], "versions": [], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-07-02T21:56:59.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "The problem begins in *TiHTTPClient.java*, {{handleEntityData()}}.\r\n\r\nIf the response size > 512K ({{totalSize > maxBufferSize}}) it calls {{createFileResponseData(true)}} and a temporary data file is created ({{outFile = TiFileFactory.createDataFile(\"tihttp\", \"tmp\")}}).\r\n\r\nThis file is never deleted and remains in the appdata directory.", "attachment": [], "flagged": false, "summary": "Android: TiHTTPClient leaking files when response > 512K", "creator": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "subtasks": [], "reporter": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "environment": "Android all versions", "closedSprints": [ { "id": 1034, "state": "closed", "name": "2018 Sprint 10 SDK", "startDate": "2018-05-07T00:03:21.636Z", "endDate": "2018-05-21T00:03:00.000Z", "completeDate": "2018-05-20T20:54:58.928Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "376212", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Can you provide a full test code and steps to reproduce the issue that you are having? We will try to regenerate the issue in out environment. Please be more descriptive as possible Also please provide the full environment info in where you are generating the issue. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-02-08T09:24:49.000+0000", "updated": "2016-02-08T09:24:49.000+0000" }, { "id": "376213", "author": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "I don't know how to reproduce this, it happens occasionally. I can see the problem just by looking at the code.", "updateAuthor": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2016-02-08T09:29:10.000+0000", "updated": "2016-02-08T09:29:10.000+0000" }, { "id": "404872", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "Having the same issue. I've got my hands on a device that has been using my app since October. There was 100mb of http client responses in there. A couple every day (even though there are many more requests done by the user/app/phone).\r\n\r\nThe line of code that is creating the files is here: https://github.com/appcelerator/titanium_mobile/blob/64534e425e303fdb17834a10faf98101da440d3e/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java#L283\r\n\r\nI can (almost) confirm it happens > 512k. But there is 1 file that is 16kb on the device. All the others are bigger.\r\n\r\nI could imagine it having to do with the excludeFromCleanup line but I'm not familiar enough with the code to be able to conclude/confirm that\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/blob/64534e425e303fdb17834a10faf98101da440d3e/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java#L271", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-19T17:03:32.000+0000", "updated": "2017-01-19T18:43:47.000+0000" }, { "id": "437685", "author": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "updateAuthor": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2018-05-16T14:44:04.000+0000", "updated": "2018-05-16T14:44:04.000+0000" }, { "id": "437686", "author": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "This ticket was opened over 2 years ago. They don't care.\r\nI'm deleting these files when the app first starts so they don't add up.", "updateAuthor": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2018-05-16T14:49:35.000+0000", "updated": "2018-05-16T14:51:36.000+0000" }, { "id": "437700", "author": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/10055", "updateAuthor": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2018-05-16T16:50:45.000+0000", "updated": "2018-05-16T16:50:45.000+0000" }, { "id": "437721", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR merged, thanks [~s.volkov]! The patch can be applied locally today if required.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-17T07:11:43.000+0000", "updated": "2018-05-17T07:11:43.000+0000" }, { "id": "438943", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket*. Fix verified in SDK Version {{7.3.0.v20180628132121}}\r\n\r\n*FR passed (Test Steps)* \r\n# Created an application with the following code \r\n{code:java}\r\nconst win = Ti.UI.createWindow({ backgroundColor: 'gray' }),\r\n client = Ti.Network.createHTTPClient({\r\n onload: (e) => {\r\n const isTemp = e.source.responseData.nativePath.includes('cache/_tmp') !== -1;\r\n alert(`path: ${e.source.responseData.nativePath}\\n\\nisTemp: ${isTemp}`);\r\n },\r\n onerror: (e) => {\r\n Ti.API.error(e.error);\r\n },\r\n timeout: 3000\r\n });\r\n#R\r\n\r\nclient.open('GET', 'https://www.nasa.gov/sites/default/files/thumbnails/image/sun_0.jpg');\r\nclient.send();\r\n\r\nwin.open();\r\n{code}\r\n# Ran the program\r\n# Able to see HTTP responses save in \"temp storage\" instead of 'app-data://'.\r\n\r\n*Test environment*\r\n{code:java}\r\nAPPC Studio: 5.0.0.201712081732\r\nAPPC CLI: 7.0.4\r\nPixel XL (8.1.0)\r\nOperating System Name: Mac OS High Sierra\r\nOperating System Version: 10.13\r\nNode.js Version: 8.9.1\r\nXcode 9.2\r\n{code}\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-07-02T21:56:43.000+0000", "updated": "2018-07-02T21:56:43.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }