{ "id": "172143", "key": "TIMOB-26342", "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": [], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2018-09-14T17:36:04.000+0000", "created": "2018-08-29T08:18:43.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "bluebird", "investigation", "ios12", "promise" ], "versions": [ { "id": "20183", "description": "", "name": "Release 7.4.0", "archived": false, "released": true, "releaseDate": "2018-09-17" }, { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "issuelinks": [], "assignee": null, "updated": "2018-09-14T17:36:04.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "(Via Slack community)\r\n\r\nThe developer is trying to run app on iOS 12.0 Beta and it crashes with the following error logs:\r\n\r\n{code}\r\nApp_Test 0x00000001007c5468 -[KrollEval jsInvokeInContext:exception:] (KrollContext.m:643)\r\nApp_Test 0x00000001007c23fc -[KrollBridge loadCommonJSModule:withSourceURL:] (KrollBridge.m:734)\r\nApp_Test 0x00000001007c2ec4 -[KrollBridge loadJavascriptText:fromFile:withContext:] (KrollBridge.m:922)\r\nApp_Test 0x00000001007c3124 -[KrollBridge loadAsFile:withContext:] (KrollBridge.m:986)\r\nApp_Test 0x00000001007c3338 -[KrollBridge loadAsFileOrDirectory:withContext:] (KrollBridge.m:1055)\r\nApp_Test 0x00000001007c38d4 -[KrollBridge require:path:] (KrollBridge.m:1167)\r\nApp_Test 0x00000001007c68b4 CommonJSRequireCallback (KrollContext.m:249)\r\nApp_Test 0x00000001e6e3a1d8 0x00000001e6daf000 + 569816\r\n{code}\r\n\r\n- A reproducible test-app can be found [here|https://github.com/sachincredible9/ModelTemplateTest]\r\n- The full discussion can be found [here|https://ti-slack.slack.com/archives/C03CVQX2A/p1534443895000100]\r\n\r\nLooking at the provided error log, it seems like evaluating a javascript-file fails in {{loadCommonJSModule}} after requiring a common-js file. I am not sure so far if this happens with Alloy (and the model-binding with Backbone) only or classic Titanium apps as well. The app works fine on iOS < 12, e.g. iOS 11.4.1", "attachment": [], "flagged": false, "summary": "iOS 12: App crashes in certain Ti.Database / Promises operations", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": "iOS 12\r\nSDK 7.4.0 / 7.5.0", "closedSprints": [ { "id": 1073, "state": "closed", "name": "2018 Sprint 19 SDK", "startDate": "2018-09-09T21:02:56.422Z", "endDate": "2018-09-23T21:02:00.000Z", "completeDate": "2018-09-23T22:28:10.932Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "441175", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "*Wait*. This may be unrelated to the Ti.Database code. I bet it is related to the \"Bluebird\" library used to handle promises that relate to the database operations. I'm pretty sure other async operations would trigger the same issue. Also, that guess is hardened by the fact that the error occurs while require'ing a CommonJS module, which..well..\"app/lib/bluebird.js\" is. I also remember that we had issue with the Bluebird library before. Is this still needed these days with us supporting ES6+?\r\n\r\nPlease see ALOY-1604 which is about a related issue with Bluebird incl. a way around the error. I assume iOS 12 adds some ES6 API's built-ins (like some {{Promise}} specs), which overlap with the ones provided by Bluebird.\r\n\r\nNot wanting to drag you into this [~eharris], but you have stated good points on the other discussion and will likely have more insight here. In the meantime, I will find out what part of the library causes it.\r\n\r\n*EDIT*: Besides that, testing with 7.4.0.v20180828081144, it does not crash. Let's wait for the reporter and some more details. Removing 7.4.0 milestone again for now.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-08-29T08:42:38.000+0000", "updated": "2018-08-29T08:55:04.000+0000" }, { "id": "441250", "author": { "name": "Nirmalkumar_Patel", "key": "nirmalkumar_patel", "displayName": "Nirmal", "active": true, "timeZone": "America/Chicago" }, "body": "Following above observation, our team tried to get rid of bluebird.js and refactored the test-app to use native promises. \r\nHowever, the test-app still crashes trying to Model.save() to SQLite.\r\n\r\nThe refactored test-app can be found at https://github.com/sachincredible9/ModelTemplateTest/tree/feature/Appc_ES6_Promise ", "updateAuthor": { "name": "Nirmalkumar_Patel", "key": "nirmalkumar_patel", "displayName": "Nirmal", "active": true, "timeZone": "America/Chicago" }, "created": "2018-08-31T05:39:54.000+0000", "updated": "2018-08-31T05:39:54.000+0000" }, { "id": "441253", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~Nirmalkumar_Patel] Thanks for the feedback. One of our core-engineers and myself tried your sample app with the above 7.4.0 build and it worked fine. We will retry with your new sample-app and report back.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-08-31T09:32:31.000+0000", "updated": "2018-08-31T09:32:31.000+0000" }, { "id": "441254", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~Nirmalkumar_Patel] Can I ask what version of the iOS 12 beta your device is on? I just ran the latest code provided using Titanium SDK 7.5.0.v20180829030547, and iOS 12 beta version 16A5365b on an iPhone 6 Plus and the app runs through fine with me ending with.\r\n\r\n{code}\r\n[INFO] ********All Test executed SUCESSFULLY.********\r\n[INFO] *****END OF TEST ******\r\n{code}", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2018-08-31T10:54:36.000+0000", "updated": "2018-08-31T10:54:36.000+0000" }, { "id": "441259", "author": { "name": "Nirmalkumar_Patel", "key": "nirmalkumar_patel", "displayName": "Nirmal", "active": true, "timeZone": "America/Chicago" }, "body": "Hi @Ewan\r\nWe retested on the following setup and latest code (using native promise) is running fine.\r\niOS version: 16A5365b \r\nDevice: iPhone6+ \r\nAppc SDK: 7.5.0.v20180829030547\r\n\r\nWe use bluebird.js extensively in our production app (.reflect, .map, custom Errors) so it wont be easy to migrate to using native promises.\r\n\r\nRight now we are refactoring our app code to move all SQLite .save()s into a .then() handler instead the mapper function of Promise.map. \r\n\r\nI will share any further observations on this thread for your information.\r\n\r\n\r\n", "updateAuthor": { "name": "Nirmalkumar_Patel", "key": "nirmalkumar_patel", "displayName": "Nirmal", "active": true, "timeZone": "America/Chicago" }, "created": "2018-08-31T17:02:25.000+0000", "updated": "2018-08-31T17:04:23.000+0000" }, { "id": "441272", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks! Keeping this ticket open for now.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-09-02T16:11:05.000+0000", "updated": "2018-09-02T16:11:05.000+0000" }, { "id": "441438", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~Nirmalkumar_Patel] Any update here?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-09-10T13:04:20.000+0000", "updated": "2018-09-10T13:04:20.000+0000" }, { "id": "441441", "author": { "name": "Nirmalkumar_Patel", "key": "nirmalkumar_patel", "displayName": "Nirmal", "active": true, "timeZone": "America/Chicago" }, "body": "Hi @Hans,\r\nWe have worked around this issue by moving all .save()s into a .then handler.\r\n\r\nThanks.\r\n", "updateAuthor": { "name": "Nirmalkumar_Patel", "key": "nirmalkumar_patel", "displayName": "Nirmal", "active": true, "timeZone": "America/Chicago" }, "created": "2018-09-10T16:24:51.000+0000", "updated": "2018-09-10T16:24:51.000+0000" }, { "id": "441581", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks! I will resolve this issue for now, but keep track if there is an indicator for an SDK-side issue. Thanks again for the flexible communication!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-09-14T17:36:04.000+0000", "updated": "2018-09-14T17:36:04.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }