[TIMOB-18118] iOS: ti.cloud - App crashes on launch if you require in ti.cloud module with SDK 3.5.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-12-07T23:34:11.000+0000 |
Affected Version/s | Release 3.5.0 |
Fix Version/s | Release 3.5.0, Release 4.0.0 |
Components | iOS |
Labels | qe-3.5.0, regression |
Reporter | Wilson Luu |
Assignee | Vishal Duggal |
Created | 2014-12-02T02:59:44.000+0000 |
Updated | 2014-12-08T19:32:30.000+0000 |
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.
*Notes:*
* This is a *regression* as this does not occur in SDK 3.4.1.GA
* -This issue it *not reproducible* if you require in APM-
*Steps to reproduce:*
1. Create the default Titanium classic app
2. Include this snippet of code in app.js (snippet of code is from ti.cloud.js):
var e;
null == e && (e = {});
e.declareClass = function(a, d, b) {
var e = a[d];
a[d] = b;
if (null != b && null != e)
for (var f in e) "prototype" != f && (b[f] = e[f]);
return b
};
e.declareClass(e, "SignatureMethod", function() {});
3. Install app to device
4. Launch app
*Actual:* App will crash on launch; see crash.log and console.log.
*Expected:* App should not crash if you require in the GA ti.cloud module.
Attachments
File | Date | Size |
---|---|---|
console.log | 2014-12-02T02:59:44.000+0000 | 1395538 |
crash.log | 2014-12-02T02:59:44.000+0000 | 44070 |
ti.cloud.js | 2014-12-02T21:22:41.000+0000 | 51503 |
[~wluu], since the module is common.js, can you strip down the module to see if you can narrow down the cause?
More info: After 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. And, 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.
More info: In the block of code that I mentioned above (line 681 - 927), the exact error is occurring in the following function:
For what ever reason, the function is not reaching the return statement.
TIMOB-18135 is similar bug to this scenario. Following is the actual code of crash here
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. Tested on: Appcelerator Studio, build: 3.4.1.201410281743 SDK build: 3.5.0.v20141208092926 CLI: 3.4.1 Alloy: 1.5.1 Xcode: 6.1.1 GM Devices: iphone 6 plus (8.1.1)