Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6029] Android: Response cache doesn't request images after they are cleaned

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-03-11T22:26:00.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterMarshall Culpepper
AssigneeMarshall Culpepper
Created2011-11-05T13:34:51.000+0000
Updated2012-03-11T22:26:00.000+0000

Description

After the cleanup timer executes (around 1 minute), and cached images will be cleared out and subsequent image loads fail with exceptions.

Comments

  1. Allen Yeung 2011-12-28

    I could not reproduce this in master. I had to remove the check for max_cache size, so it cleans the directory regardless of the cache size (TiResponseCache.java line 93). I ran the following app.js:
       Titanium.UI.setBackgroundColor('#000');
       
       
       var win1 = Titanium.UI.createWindow({  
           title:'Tab 1',
           backgroundColor:'#fff'
       });
       
       var button = Titanium.UI.createButton({
           title:'open new window'
       });
       
       var webview = Ti.UI.createImageView({
           top: 0, left: 0, width: 100, height: 50,
           image: 'http://www.appcelerator.com/wp-content/themes/appcelerator/img/APPC_logo.png'
       });
       
       var win2 = Titanium.UI.createWindow({  
           title:'Tab 2',
           backgroundColor:'#fff'
       });
       
       win2.add(webview);
       
       button.addEventListener('click', function(){
           win2.open();
       });
       
       var button2 = Titanium.UI.createButton({
           title:'close window'
       });
       
       button2.addEventListener('click', function(){
           win2.close();
       });
       
       win2.add(button2);
       
       win1.add(button);
       win1.open();
       
    1. Launch the app 2. click on the button to open a new window. 3. Use DDMS to browse the cache directory /mnt/sdcard/Android/data//cache/_tmp/remote-image-cache 4. Wait for the cache directory to clear 5. Close the window by clicking the button 6. Reopen the window by clicking the button The cache directory re-populates after the window is reopened.
  2. Michael Pettiford 2012-01-24

    Closing this issue Tested with Allens test steps to reproduce and verified expected behavior *Note had to edit TiResponseCache.java to repro and scons

JSON Source