{ "id": "140774", "key": "TIMOB-18118", "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": "16704", "description": "Release 3.5.0", "name": "Release 3.5.0", "archived": false, "released": true, "releaseDate": "2015-01-13" }, { "id": "16593", "description": "Release 4.0.0", "name": "Release 4.0.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-12-07T23:34:11.000+0000", "created": "2014-12-02T02:59:44.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "qe-3.5.0", "regression" ], "versions": [ { "id": "16704", "description": "Release 3.5.0", "name": "Release 3.5.0", "archived": false, "released": true, "releaseDate": "2015-01-13" } ], "issuelinks": [ { "id": "43597", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "140772", "key": "ALOY-1192", "fields": { "summary": "iOS: apps crashing using TiSDK 3.5.X ", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-12-08T19:32:30.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Details:* If you require in the GA ti.cloud module (3.2.7) into your app running SDK 3.5.0, then your app will crash on launch. Specifically, this line of code from ti.cloud.js: {{if (null != b && null != e)}}. However, if you use strict equal, e.g. {{if (null !== b && null !== e)}}, then the app will launch fine.\r\n\r\n*Notes:*\r\n* This is a *regression* as this does not occur in SDK 3.4.1.GA\r\n* -This issue it *not reproducible* if you require in APM-\r\n\r\n*Steps to reproduce:*\r\n1. Create the default Titanium classic app\r\n2. Include this snippet of code in app.js (snippet of code is from ti.cloud.js):\r\n{code}\r\nvar e;\r\n\r\nnull == e && (e = {});\r\n\r\ne.declareClass = function(a, d, b) {\r\n var e = a[d];\r\n a[d] = b;\r\n if (null != b && null != e)\r\n for (var f in e) \"prototype\" != f && (b[f] = e[f]);\r\n return b\r\n};\r\n\r\ne.declareClass(e, \"SignatureMethod\", function() {});\r\n{code}\r\n3. Install app to device\r\n4. Launch app\r\n\r\n*Actual:* App will crash on launch; see crash.log and console.log.\r\n*Expected:* App should not crash if you require in the GA ti.cloud module.", "attachment": [ { "id": "52939", "filename": "console.log", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-12-02T02:59:44.000+0000", "size": 1395538, "mimeType": "text/plain" }, { "id": "52938", "filename": "crash.log", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-12-02T02:59:44.000+0000", "size": 44070, "mimeType": "text/plain" }, { "id": "52967", "filename": "ti.cloud.js", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-12-02T21:22:41.000+0000", "size": 51503, "mimeType": "text/javascript" } ], "flagged": false, "summary": "iOS: ti.cloud - App crashes on launch if you require in ti.cloud module with SDK 3.5.0", "creator": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Appcelerator Studio, build: 3.4.1.201410281743 \r\nSDK build: 3.5.0.v20141201152532\r\nti.cloud: 3.2.7 (GA)\r\nCLI: 3.4.1 \r\nAlloy: 1.5.1 \r\nXcode: 6.1.1 GM Seed \r\nDevices: iphone 6 plus (8.1), iphone 5 (7.1.1)", "comment": { "comments": [ { "id": "334290", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~wluu], since the module is common.js, can you strip down the module to see if you can narrow down the cause?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-12-02T03:06:04.000+0000", "updated": "2014-12-02T03:06:04.000+0000" }, { "id": "334392", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "More info:\r\n\r\nAfter beautifying ti.cloud.js and further investigation with Jon, line 681 - 927 seems to be the cause of the issue. It looks like that block of code is using old OAuth code from Netflix.\r\n\r\nAnd, if I comment out the block of code (line 681 - 927) and repeat the reproducible steps, my app does not crash. Attached my modified ti.cloud.js.", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-12-02T21:22:07.000+0000", "updated": "2014-12-02T21:26:45.000+0000" }, { "id": "334583", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "More info:\r\n\r\nIn the block of code that I mentioned above (line 681 - 927), the exact error is occurring in the following function:\r\n{code}\r\ne.declareClass = function(a, d, b) {\r\n var e = a[d];\r\n a[d] = b;\r\n if (null != b && null != e)\r\n for (var f in e) \"prototype\" != f && (b[f] = e[f]);\r\n return b\r\n};\r\n{code}\r\n\r\nFor what ever reason, the function is not reaching the return statement.", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-12-03T18:42:53.000+0000", "updated": "2014-12-03T18:42:53.000+0000" }, { "id": "334785", "author": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "body": "TIMOB-18135 is similar bug to this scenario.\r\n\r\nFollowing is the actual code of crash here\r\n{code}\r\nif (null != b && null != e) // It crashes in this line if either 'b' or 'e' is null.\r\n // some code here\r\n{code}", "updateAuthor": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2014-12-04T07:47:15.000+0000", "updated": "2014-12-04T07:47:15.000+0000" }, { "id": "335423", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed. Verified that if you require in ti.cloud 3.2.7 into your app.js, your app will not crash. Also, verified the above sample code does not make the app crash.\r\n\r\nTested on:\r\n\r\nAppcelerator Studio, build: 3.4.1.201410281743\r\nSDK build: 3.5.0.v20141208092926\r\nCLI: 3.4.1\r\nAlloy: 1.5.1\r\nXcode: 6.1.1 GM \r\nDevices: iphone 6 plus (8.1.1)\r\n\r\n", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-12-08T19:32:06.000+0000", "updated": "2014-12-08T19:32:06.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }