GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-07-20T14:12:30.000+0000 |
Affected Version/s | Release 9.0.1, Release 9.0.0, Release 9.0.2, Release 9.0.3 |
Fix Version/s | Release 9.1.0 |
Components | iOS |
Labels | ios, regression |
Reporter | Hugo Ramos Freire Neto |
Assignee | Christopher Williams |
Created | 2020-03-10T17:37:42.000+0000 |
Updated | 2020-08-07T13:29:08.000+0000 |
When I use Ti.Platform.openURL, and the app goes to background, the app crashes with this error:
[ERROR] Script Error {
[ERROR] toJSON = "";
[ERROR] }
The issue is a regression in SDK 9.0.0.GA. Do not see this issue with SDK 8.3.1.GA. Tested with Mac OS: 10.15.4 SDK: 9.0.0.GA, 8.3.1.GA Appc CLI: 8.0.0 JDK: 11.0.4 Node: 10.17.0 Studio: 6.0.0.202003181504 Xcode: 11.4 Device: iOS simulator 13.4, iOS simulator 12.2
Seeing this as well. Adding the optional callback parameter will remove error:
Ti.Platform.openURL(url, null, ()=>{});
How can this issue not be scheduled so far? SDK 9 regression, critical crash, reproducible every time, already 3+ months old. Come on Axway!
PR: https://github.com/appcelerator/titanium_mobile/pull/11826 Example:
Well this was a dumb error on my part. I misunderstood how the new JSC API would handle an optional callback argument - I assumed it'd be
nil
. It is not! It's aJSValue \*
equivalent toundefined
. So any APIs with an optional callback using the new JSC API need to explicitly check the arg is both not nil, *and* is actually a function. Thanks for the PR [~hknoechel], that's what clued me in to the issue here. The fix is relatively straight-forward and I'll push it today.Fixed in https://github.com/appcelerator/titanium_mobile/commit/31424c6c2e85ad5d18c5d45c156221545e8a0e22 (cherry-picked to 9_1_X and 9_3_X)
For good measure, I also cherry-picked back to 9_0_X branch
*Closing ticket*. Fix verified in SDK version
9.1.0.v20200724110711
,9.2.0.v20200724112452
,9.0.4.v20200720071447
and9.3.0.v20200724114100
. Tested using the following test case:Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/commit/31424c6c2e85ad5d18c5d45c156221545e8a0e22 *Test Environment*