[TIMOB-20367] Android: TiHTTPClient leaking files when response > 512K
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-17T07:10:38.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.3.0 |
Components | Android |
Labels | android |
Reporter | grebulon |
Assignee | Gary Mathews |
Created | 2016-02-04T11:51:14.000+0000 |
Updated | 2018-07-02T21:56:59.000+0000 |
Description
The problem begins in *TiHTTPClient.java*,
handleEntityData()
.
If the response size > 512K (totalSize > maxBufferSize
) it calls createFileResponseData(true)
and a temporary data file is created (outFile = TiFileFactory.createDataFile("tihttp", "tmp")
).
This file is never deleted and remains in the appdata directory.
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.
I don't know how to reproduce this, it happens occasionally. I can see the problem just by looking at the code.
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). The 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 I can (almost) confirm it happens > 512k. But there is 1 file that is 16kb on the device. All the others are bigger. I 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 https://github.com/appcelerator/titanium_mobile/blob/64534e425e303fdb17834a10faf98101da440d3e/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java#L271
This ticket was opened over 2 years ago. They don't care. I'm deleting these files when the app first starts so they don't add up.
https://github.com/appcelerator/titanium_mobile/pull/10055
PR merged, thanks [~s.volkov]! The patch can be applied locally today if required.
*Closing ticket*. Fix verified in SDK Version
7.3.0.v20180628132121
*FR passed (Test Steps)*Created an application with the following code
Ran the program
Able to see HTTP responses save in "temp storage" instead of 'app-data://'.
*Test environment*