{ "id": "149431", "key": "TIMOB-19157", "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": "16723", "description": "Windows Platform Support, ListView updates, Vector overlays in maps", "name": "Release 4.1.0", "archived": false, "released": true, "releaseDate": "2015-07-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-07-06T17:40:45.000+0000", "created": "2015-07-03T13:20:05.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "16723", "description": "Windows Platform Support, ListView updates, Vector overlays in maps", "name": "Release 4.1.0", "archived": false, "released": true, "releaseDate": "2015-07-08" } ], "issuelinks": [ { "id": "48304", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "149421", "key": "TIMOB-19152", "fields": { "summary": "Windows: App crashes on second launch when encryption is enabled", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2015-07-06T20:24:13.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "The following example works in the emulator but fails on the {{.js}} file on device:\r\n\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow();\r\nvar btn = Ti.UI.createButton({\r\n\ttitle: 'Click'\r\n});\r\n\r\nbtn.addEventListener('click', function (e) {\r\n\r\n\ttry {\r\n\t\tvar txt = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'file.txt');\r\n\t\ttxt.write('Hello world');\r\n\t\ttxt.read();\r\n\t} catch (e) {\r\n\t\talert('TXT failed: ' + JSON.stringify(e));\r\n\t}\r\n\r\n\ttry {\r\n\t\tvar js = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'file.js');\r\n\t\tjs.write('Hello world');\r\n\t\tjs.read();\r\n\t} catch (e) {\r\n\t\talert('JS failed: ' + JSON.stringify(e));\r\n\t}\r\n\r\n\talert('all OK');\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}\r\n\r\nh2. Error\r\n\r\n{code}\r\n{\r\n \"message\": \"Could not load module: module_path = C:\\\\Data\\\\Users\\\\DefApps\\\\APPDATA\\\\Local\\\\Packages\\com.appc.test_339c21w222ff8\\\\LocalState\\\\file.js\",\r\n \"native_stack\": [\"JSExportClass::CallNamedFunction\"],\r\n \"stack\": \"read@[native code]\\n\",\r\n \"line\": 1\r\n}\r\n{code}\r\n\r\nIt looks like the {{.js}} extension triggers it (but only on device) to use [readRequiredModule|https://github.com/appcelerator/titanium_mobile_windows/blob/master/Source/Global/src/GlobalObject.cpp#L172-L179] and then fails. It's the only place where I could find this error.\r\n\r\nIn addition the attached screenshots also show another bug, where a caught exception in an event listener still causes another exception raised?", "attachment": [ { "id": "56081", "filename": "IMG_6424.JPG", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-07-03T13:15:10.000+0000", "size": 2356639, "mimeType": "image/jpeg" }, { "id": "56080", "filename": "IMG_6425.JPG", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-07-03T13:15:32.000+0000", "size": 4132006, "mimeType": "image/jpeg" } ], "flagged": false, "summary": "Windows: Ti.Filesystem.File.read() fails on device only if file has .js extension", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 4.1.0.v20150701131146\r\nEmulator 8-1-1 (works)\r\nNokia Lumia", "closedSprints": [ { "id": 443, "state": "closed", "name": "2015 Sprint 14 Windows", "startDate": "2015-07-06T04:01:52.896Z", "endDate": "2015-07-19T03:59:00.000Z", "completeDate": "2015-07-20T22:18:14.505Z", "originBoardId": 144 } ], "comment": { "comments": [ { "id": "356976", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "May be related to TIMOB-19152", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-07-06T14:02:21.000+0000", "updated": "2015-07-06T14:07:15.000+0000" }, { "id": "357003", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes, this was fixed with TIMOB-19152", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-07-06T17:39:52.000+0000", "updated": "2015-07-06T17:39:52.000+0000" }, { "id": "357033", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\n\r\nTi.Filesystem.File.read() does not fail.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio: 4.1.0.201507031129\r\nTi SDK: 4.1.0.v20150706111546\r\nTi CLI: 4.0.1\r\nAlloy: 1.6.2\r\nWindows: 8.1 Enterprise 64-bit\r\nAPPC NPM: 4.1.0-1\r\nAPPC CLI: 4.1.0-5 \r\nDevice: Nokia Lumia 928 - Windows Phone 8.1\r\n\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-07-06T20:24:02.000+0000", "updated": "2015-07-06T20:24:02.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }