{ "id": "65606", "key": "TIMOB-4146", "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": "11355", "description": "Mobile 1.8.0 M02", "name": "Sprint 2011-23", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-11-05T13:49:29.000+0000", "created": "2011-05-19T14:52:50.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "11260", "description": "", "name": "Release 1.6.2", "archived": true, "released": true, "releaseDate": "2011-04-20" } ], "issuelinks": [], "assignee": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "updated": "2011-11-05T13:49:29.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": "Aborting large file download crashes the app.\r\n\r\nStep 1: run the code below\r\nStep 2: start the download\r\nStep 3: abort the download or wait for it to auto abort\r\nStep 4: wait for a few seconds and the app will crash\r\n\r\nError:\r\n{code:javascript}\r\n[TRACE] W/dalvikvm( 830): threadid=10: thread exiting with uncaught exception (group=0x4001d800)\r\n[TRACE] E/TiUncaughtHandler( 830): (TiHttpClient-1) [4,18096] Sending event: exception on thread: TiHttpClient-1 msg:java.lang.NullPointerException; Titanium 1.6.2,2011/04/18 17:16,78906d\r\n[TRACE] E/TiUncaughtHandler( 830): java.lang.NullPointerException\r\n[TRACE] E/TiUncaughtHandler( 830): at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1009)\r\n[TRACE] E/TiUncaughtHandler( 830): at java.lang.Thread.run(Thread.java:1096)\r\n[TRACE] E/AndroidRuntime( 830): FATAL EXCEPTION: TiHttpClient-1\r\n[TRACE] E/AndroidRuntime( 830): java.lang.NullPointerException\r\n[TRACE] E/AndroidRuntime( 830): at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1009)\r\n[TRACE] E/AndroidRuntime( 830): at java.lang.Thread.run(Thread.java:1096)\r\n[TRACE] W/ActivityManager( 60): Force finishing activity com.appcelerator.test1/.Test1Activity\r\n{code}\r\nExample code:\r\n{code:javascript}\r\nvar win = Titanium.UI.createWindow();\r\n\r\nvar ind=Titanium.UI.createProgressBar({\r\n\twidth:200,\r\n\theight:50,\r\n\tmin:0,\r\n\tmax:1,\r\n\tvalue:0,\r\n\ttop:10,\r\n\tmessage:'Downloading ' + (Ti.Platform.name == 'android' ? 'PNG' : 'PDF') + ' File',\r\n\tfont:{fontSize:12, fontWeight:'bold'},\r\n\tcolor:'#888'\r\n});\r\n\r\nwin.add(ind);\r\nind.show();\r\n\r\nvar abort = Titanium.UI.createButton({\r\n\ttitle:'Abort',\r\n\theight:40,\r\n\twidth:200,\r\n\ttop:170\r\n});\r\nwin.add(abort);\r\nabort.addEventListener('click', function()\r\n{\r\n\tc.abort();\r\n\tind.value = 0;\r\n});\r\n\r\nvar largeFile = Titanium.UI.createButton({\r\n\ttitle:'Large File Download',\r\n\theight:40,\r\n\twidth:200,\r\n\ttop:220\r\n});\r\nwin.add(largeFile);\r\n\r\nlargeFile.addEventListener('click', function()\r\n{\r\n\tind.value = 0;\r\n\tc = Titanium.Network.createHTTPClient();\r\n\tvar myAbort = function(e){\r\n\t\tTi.API.info('Aborted!!!');\r\n\t\tc.abort();\r\n\t}\r\n\t\r\n\tc.setTimeout(10000);\r\n\tc.onload = function(e)\r\n\t{\r\n\t\tTi.API.info(\"ONLOAD = \"+e);\r\n\t};\r\n\tc.ondatastream = function(e)\r\n\t{\r\n\t\tind.value = e.progress ;\r\n\t\tTi.API.info('ONDATASTREAM1 - PROGRESS: ' + e.progress);\r\n\t\tif(e.progress > .02){\r\n\t\t\tmyAbort();\r\n\t\t}\r\n\t};\r\n\tc.onerror = function(e)\r\n\t{\r\n\t\tTi.UI.createAlertDialog({title:'XHR', message:'Error: ' + e.error}).show();\r\n\t};\r\n\r\n\tc.open('GET','http://www.appcelerator.com/download-win32');\r\n\tc.send();\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\nh3. Associated Helpdesk Ticket\r\nhttp://appc.me/c/APP-476121\r\n", "attachment": [ { "id": "20995", "filename": "tsDefault.zip", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2011-06-08T13:36:09.000+0000", "size": 5358046, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: aborting large file download crashes app with NullPointerException", "creator": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 1.6.2,\r\nAndroid 2.2 Simulator", "comment": { "comments": [ { "id": "155756", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "test app to verify fix. Once \"Large File Download\" is selected, read the logcat to see that onload fires. Should be able to call multiple times in the test app but wait till the current test finishes before starting another.", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2011-06-08T13:36:09.000+0000", "updated": "2011-06-08T13:36:09.000+0000" }, { "id": "157707", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "merged to 1_7_X", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-23T17:05:50.000+0000", "updated": "2011-06-23T17:05:50.000+0000" }, { "id": "158850", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with Nexus S 2.3.4 and Nexus One 2.2.2 with 1.7.2.v20110630161836", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-07-06T17:37:55.000+0000", "updated": "2011-07-06T17:37:55.000+0000" }, { "id": "171615", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Standardizing summary and labels.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T13:48:52.000+0000", "updated": "2011-11-05T13:48:52.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }