{ "id": "63727", "key": "TIMOB-3095", "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": "11242", "name": "Release 1.6.0 M09", "archived": true, "released": true, "releaseDate": "2011-02-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T02:00:54.000+0000", "created": "2011-04-15T03:36:46.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "defect", "release-1.6.0", "reported-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T02:00:54.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": "{html}
For example, we check for \"Cache-Control\" and would miss\n\"cache-control\". According to this\nheaders are case-insensitive.
\nFailcase app.js:
\n\n\nTitanium.UI.setBackgroundColor('#000');\nvar win = Titanium.UI.createWindow({ \n title:'Test',\n backgroundColor:'#000',\n exitOnClose: true\n});\nvar thisURL = \"module=MultiSites&action=getEvolutionGraph&period=day&date=2011-01-04,2011-02-02&evolutionBy=visits&columns=nb_visits&idSite=7&idsite=7&viewDataTable=sparkline\";\n\nvar paramArray = thisURL.split(\"&\");\nfor(var i=0,ilen=paramArray.length;i<ilen;i++){\n var thisKeyValue = paramArray[i].split(\"=\");\n thisKeyValue[1] = Ti.Network.encodeURIComponent(thisKeyValue[1]);\n paramArray[i] = thisKeyValue.join(\"=\");\n}\nvar encodedURI = paramArray.join(\"&\");\nvar encodedURL = \"http://demo.piwik.org/index.php?\" + encodedURI;\nTi.API.info(encodedURL);\n\nvar imageView = Ti.UI.createImageView({\n image: encodedURL\n});\n \nwin.add(imageView);\nwin.open();
\n
\nFollow these steps:
\nCreate a new titanium project and make the code above its\napp.js.
\nRun the app. The app will crash because of #3094, but\nthat's okay because it's already written to the cache.
\nAt the command line do the following commands.
\n\nadb shell\ncd /sdcard/[your app id]/remote-image-cache\nls\ncat *.hdr
\n
\n(But of course replace [your app id] with your app's id.)
\nAfter entering the ls
command, you will see files\nlisted. There should not be any, because the file that is being\ncached there should not have been cached. You can see that because\nof the cat
command which shows you the http headers\nretrieved upon getting the remote file. One of the headers is\ncache-control
and it indicates that the file should\nnot be cached. But it was, and the reason is\nbecause we were looking for Cache-Control
in a\ncase-sensitive fashion, so we missed\ncache-control
.
Important notes re testing the fix
\nOnce you're ready to test the fix, you need to be sure to\nclear the cache to get rid of those files that\nshouldn't have been there in the first place.
\n\nadb shell\ncd /sdcard\nrm -r [your app id]
\n
\nAnd when you test the fix, don't be shocked if no image at all\nappears on screen. That's bug #3093. For\nthis test, you just want to be sure that after you launch the app\nthere is nothing in the remote-image-cache for your app.
(from [4f7ca257dc0c13829996d2c6503cce5effff8388])\nAccess headers in case-insensitive fashion, do not write out\ntransfer-encoding: chunked header, fix regular expression that\nchecks for no caching, fix removal of uri from set of uris\ncurrently downloading. [#3095 state:fixed-in-qa][#3094\nstate:fixed-in-qa] \nhttps://github.com/appcelerator/titanium_mobile/commit/4f7ca257dc0c...
verified emulator 2.2
(from [d08271606cb059c5bc0d3be4a0ec809ba990fe29])\nAccess headers in case-insensitive fashion, do not write out\ntransfer-encoding: chunked header, fix regular expression that\nchecks for no caching, fix removal of uri from set of uris\ncurrently downloading. [#3095 state:fixed-in-qa][#3094\nstate:fixed-in-qa] \nhttps://github.com/appcelerator/titanium_mobile/commit/d08271606cb0...
Setting back to resolved. Was set to fixed-in-qa by cherry\npick.