{ "id": "128042", "key": "TIMOB-16672", "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": "15935", "description": "2014 Sprint 06", "name": "2014 Sprint 06", "archived": true, "released": true, "releaseDate": "2014-03-28" }, { "id": "15938", "description": "2014 Sprint 06 Tooling", "name": "2014 Sprint 06 Tooling", "archived": true, "released": true, "releaseDate": "2014-03-28" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-03-25T19:46:20.000+0000", "created": "2014-03-23T02:23:48.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "module_hybrid", "qe-testadded" ], "versions": [], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2014-05-20T20:12:23.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": "13719", "name": "Windows Hybrid", "description": "Windows Hybrid platform" } ], "description": "When testing downloading a file using tiwp8.downloadFile() and your device is offline, the app crashes. We need to capture the error and properly throw an exception.\r\n\r\nOn a side note, the XHR proxy seems to report 400 bad request for all requests when offline. That may be ok, but check what other environments do when offline and perhaps throw a better error.", "attachment": [], "flagged": false, "summary": "Windows Hybrid: Downloading a file while offline crashes the app", "creator": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "environment": null, "comment": { "comments": [ { "id": "298653", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "h1. IMPORTANT API CHANGE!\n\ndownloadFile() signature had to change to accommodate the onerror handler:\n\n{code}\ntiwp8.downloadFile({\n\turl: 'http://www.ambientreality.com/test.pdf',\n\t//saveTo: 'foo.pdf', // tmpFolder.Name,\n\toverwrite: true,\n\toncomplete: function (e) {\n\t\tvar ea = e.eventArgs,\n\t\t\tfile = ea.property('file'),\n\t\t\tsize = ea.property('size');\n\n\t\tconsole.log('Finished downloading file to ' + file);\n\t\tconsole.log('File is ' + size + ' bytes');\n\n\t\tvar currentFolder = tiwp8.staticProperty('Windows.Storage.ApplicationData', 'Current'),\n\t\t\tlocalFolder = currentFolder.property('LocalFolder');\n\n\t\t// convert the full path to a relative path\n\t\tfile = file.replace(localFolder.property('Path') + '\\\\', '');\n\n\t\tlocalFolder.invokeAsync('GetFileAsync', ['System.String', file], function (pdfFile) {\n\t\t\ttiwp8.invokeStaticAsync('Windows.System.Launcher', 'LaunchFileAsync', ['Windows.Storage.IStorageFile', pdfFile], function (success) {\n\t\t\t\tconsole.log('LaunchFileAsync success?', success);\n\t\t\t\tcurrentFolder.destroy();\n\t\t\t\tlocalFolder.destroy();\n\t\t\t\tpdfFile.destroy();\n\t\t\t});\n\t\t});\n\t},\n\tonerror: function (ex) {\n\t\talert(ex);\n\t}\n});\n{code}", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-03-25T19:35:45.000+0000", "updated": "2014-03-25T19:35:45.000+0000" }, { "id": "298658", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5525\n3_2_X_hybrid pull request: https://github.com/appcelerator/titanium_mobile/pull/5526", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-03-25T19:46:17.000+0000", "updated": "2014-03-25T19:46:17.000+0000" }, { "id": "304895", "author": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed on:\r\nWindows 8.1\r\nAppcelerator Studio, build: 3.3.0.201405121247\r\nTitanium SDK, build: 3.3.0.v20140514121712\r\nTitanium CLI, build: 3.3.0-dev\r\nWindows SDK: 8.0\r\nNokia Lumia 520: 8.0\r\n\r\nPDF file is downloaded successfully while network is connected.\r\nApp does not crash if network is not connected.\r\nClosing.", "updateAuthor": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-14T23:45:49.000+0000", "updated": "2014-05-14T23:45:49.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }