Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2495] Android: Temp files created by TiHTTPClient

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2011-11-05T13:39:16.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sSprint 2011-26, Release 1.7.2, Release 1.8.0
ComponentsAndroid
Labelsn/a
ReporterBill Dawson
AssigneeMarshall Culpepper
Created2011-04-15T03:21:15.000+0000
Updated2011-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

  1. Bill Dawson 2011-04-15

    assigned to don for mileston

  2. Alan Leard 2011-04-15

    HD Ticket Reference: http://developer.appcelerator.com/helpdesk/view/76351">http://developer.appcelerator.com/helpdesk/view/76351

  3. 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.2

    Associated Helpdesk Ticket

    http://appc.me/a/APP-646476

    Workaround

       xhr.onload = function () {
       	var response = xhr.responseText;
       	var nativePath = xhr.responseData.nativePath;
       	var tmpFile = Ti.Filesystem.getFile(nativePath);
       	tmpFile.deleteFile();
       };
       
  4. 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
  5. 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.
  6. Marshall Culpepper 2011-06-29

    New repro sequence to account for new changes: Create an app with this code in app.js:
       
       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();
       
    Run the app, click "download", and wait for the "finished downloading file" message in logcat, then close it. Make sure a temporary file exists:
       $ adb shell ls /mnt/sdcard/Android/data/<app_id>/cache/_tmp
       
    Now, re-open the app and wait 5 or so seconds. You should see a message like this:
       06-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
       
    Double check that it was deleted by running the same adb command as above
  7. Don Thorp 2011-06-30

    merge on 1.8.0. cherry-pick into 1.7.2
  8. Natalie Huynh 2011-07-06

    Tested with Nexus S 2.3.4 and Nexus One 2.2.2 with 1.7.2.v20110630161836
  9. Don Thorp 2011-11-05

    Fixing labels.

JSON Source