[TIMOB-2495] Android: Temp files created by TiHTTPClient
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-11-05T13:39:16.000+0000 |
Affected Version/s | Release 1.7.0 |
Fix Version/s | Sprint 2011-26, Release 1.7.2, Release 1.8.0 |
Components | Android |
Labels | n/a |
Reporter | Bill Dawson |
Assignee | Marshall Culpepper |
Created | 2011-04-15T03:21:15.000+0000 |
Updated | 2011-11-05T13:39:16.000+0000 |
Description
We should ...
- Not use the sdcard root, and use the app's sdcard folder instead
- delete by pattern on boot
Comments
- Bill Dawson 2011-04-15
assigned to don for mileston
- Alan Leard 2011-04-15
- Jon Alter 2011-05-31
The temp files are also not being deleted.
To see the filesystem of the emulator: In terminal run 'adb -e shell' to get into the emulator filesystem. As mentioned above, the temp files are in the root of the sdcard.
Can replicate in Kitchen Sink "Platform>XHR>File Download>Large File Download"
Step 1: launch Kitchen Sink
Step 2: In terminal run 'adb -e shell' to get into the emulator filesystem
Step 3: 'cd sdcard' to get to the root of the sdcard
Step 4: 'ls -l' in the root of the sdcard to see the contents
Step 5: in Kitchen Sink "Platform>XHR>File Download>Large File Download"
Step 6: 'ls -l' in the root of the sdcard to see the *tmp file created
Tested With
TiSDK 1.6.2, Android Emulator 2.2Associated Helpdesk Ticket
http://appc.me/a/APP-646476Workaround
xhr.onload = function () { var response = xhr.responseText; var nativePath = xhr.responseData.nativePath; var tmpFile = Ti.Filesystem.getFile(nativePath); tmpFile.deleteFile(); };
- Pedro Enrique 2011-06-09
Another HD Ticket
We have another customer asking for this to be fixed: http://support.appcelerator.com/tickets/APP-697425/homepage - Bill Dawson 2011-06-27 That test is really sensitive to timing issues since drillbit kills the app when the test is finished, and that could be before 5 seconds have elapsed, particularly when running on device, which is so quick. I wasn't ever able to get it to delete a file in the cache using drillbit on device. Trying emulator to see if the slower environment gets me a test run that lasts longer than 5 seconds. ... yeah that worked.
- Marshall Culpepper 2011-06-29
New repro sequence to account for new changes:
Create an app with this code in app.js:
Run the app, click "download", and wait for the "finished downloading file" message in logcat, then close it. Make sure a temporary file exists:var win = Ti.UI.createWindow({ backgroundColor: "white", top: 0, left: 0, right: 0, bottom: 0 }); var doDownload = Ti.UI.createButton({ title: "download" }); win.add(doDownload); doDownload.addEventListener("click", function(e) { var xhr = Ti.Network.createHTTPClient(); xhr.onload = function() { Ti.API.info("finished downloading file"); }; xhr.open('GET','http://www.appcelerator.com/download-win32'); xhr.send(); }); win.open();
Now, re-open the app and wait 5 or so seconds. You should see a message like this:$ adb shell ls /mnt/sdcard/Android/data/<app_id>/cache/_tmp
Double check that it was deleted by running the same adb command as above06-29 13:29:28.674: INFO/TiTempFileHelper(8938): (pool-3-thread-1) [4579,4579] Deleting temporary file /mnt/sdcard/Android/data/com.arcaner.sandbox2/cache/_tmp/tihttp1913818548tmp
- Don Thorp 2011-06-30 merge on 1.8.0. cherry-pick into 1.7.2
- Natalie Huynh 2011-07-06 Tested with Nexus S 2.3.4 and Nexus One 2.2.2 with 1.7.2.v20110630161836
- Don Thorp 2011-11-05 Fixing labels.