{ "id": "174832", "key": "TIMOB-27812", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "21092", "name": "Release 9.2.1", "archived": false, "released": true, "releaseDate": "2020-10-06" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-10-02T14:37:36.000+0000", "created": "2020-03-20T13:34:51.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "20033", "name": "Release 9.0.0", "archived": false, "released": true, "releaseDate": "2020-03-18" } ], "issuelinks": [], "assignee": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2020-11-02T14:13:54.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": "The error display on iOS is currently a little confusing and prints unrelated follow up errors that shouldn't be displayed at all.\r\n\r\nA very simple error like this\r\n\r\n{code:js}\r\nthrow new Error('My simple error');\r\n{code}\r\n\r\nresults in the following error printed to the logs:\r\n\r\n{code}\r\n[ERROR] Script Error {\r\n[ERROR] column = 16;\r\n[ERROR] line = 512;\r\n[ERROR] message = \"My simple error\";\r\n[ERROR] sourceURL = \"file:///Users/jvennemann/Library/Developer/CoreSimulator/Devices/277C69FF-FFFF-43E3-BC8F-17B4D7B91E52/data/Containers/Bundle/Application/D76755F9-D059-418E-B8E5-BB666A380AE7/global-test-classic.app/app.js\";\r\n[ERROR] stack = \" at (/app.js:512:16)\\n at global code(/app.js:515:70)\\n at require@[native code]\\n at (/ti.main.js:13057:10)\\n at loadAsync(/ti.main.js:12985:13)\\n at global code(/ti.main.js:13054:10)\";\r\n[ERROR] toJSON = \"\";\r\n[ERROR] } \r\n[ERROR] Script Error {\r\n[ERROR] column = 10;\r\n[ERROR] line = 13057;\r\n[ERROR] message = \"Module \\\"app.js\\\" failed to leave a valid exports object\";\r\n[ERROR] sourceURL = \"file:///Users/jvennemann/Library/Developer/CoreSimulator/Devices/277C69FF-FFFF-43E3-BC8F-17B4D7B91E52/data/Containers/Bundle/Application/D76755F9-D059-418E-B8E5-BB666A380AE7/global-test-classic.app/ti.main.js\";\r\n[ERROR] stack = \" at require@[native code]\\n at (/ti.main.js:13057:10)\\n at loadAsync(/ti.main.js:12985:13)\\n at global code(/ti.main.js:13054:10)\";\r\n[ERROR] toJSON = \"\";\r\n[ERROR] }\r\n{code}\r\n\r\nIt is not formatted at all and makes it hard to read the actual stack trace. Additionally, there is not one, but two errors shown, which is not correct.\r\n\r\nThe follow up error \"Module \\\"app.js\\\" failed to leave a valid exports object\" should be ignored and not shown at all. This is especially problematic in the error modal that will be shown on the device, where the latter error will be shown first. A user has to explicitly close this modal to get to the original error.", "attachment": [], "flagged": false, "summary": "iOS: Improve display of uncaught errors", "creator": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 1207, "state": "closed", "name": "2020 Sprint 20", "startDate": "2020-09-28T15:30:47.481Z", "endDate": "2020-10-09T15:30:00.000Z", "completeDate": "2020-10-09T16:33:43.453Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "454787", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "iOS should only display an alert dialog for the 1st exception like Android.\r\nAll the exceptions that follow the 1st one are what's confusing people.\r\n\r\nI thought I wrote up an improvement ticket for this, but I can't find it.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-03-20T18:08:26.000+0000", "updated": "2020-03-20T18:08:26.000+0000" }, { "id": "454790", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~jquick], yes, Android is doing this the right way. I plan to modify the iOS error handling to align with that. I searched for a similar ticket but also couldn't find anything.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-03-20T19:00:15.000+0000", "updated": "2020-03-20T19:00:15.000+0000" }, { "id": "457031", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "+1 for this in 9.2.1. A formatted stack trace would already help so much.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-09-25T09:58:01.000+0000", "updated": "2020-09-25T09:58:01.000+0000" }, { "id": "457068", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/12139", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-09-28T22:08:18.000+0000", "updated": "2020-09-28T22:08:18.000+0000" }, { "id": "457099", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed\r\nWaiting for Jenkins build", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-30T19:53:39.000+0000", "updated": "2020-09-30T19:53:39.000+0000" }, { "id": "457119", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master, backport PR merged to 9_2_X for 9.2.1 target.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-10-01T15:50:21.000+0000", "updated": "2020-10-01T15:50:21.000+0000" }, { "id": "457131", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket*. Fix verified in SDK version {{9.2.1.v20201001120538}}, and {{9.3.0.v20201001144501}}.\r\n\r\n*Test and other information can be found at:*\r\nhttps://github.com/appcelerator/titanium_mobile/pull/12139", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-02T14:37:28.000+0000", "updated": "2020-10-02T14:37:28.000+0000" }, { "id": "457395", "author": { "name": "icecandyent", "key": "icecandyent", "displayName": "Simon Buckingham", "active": true, "timeZone": "Europe/London" }, "body": "I'm not sure if this is relevant to this ticket, but I think you may have broken something else with this fix. This is only a guess.\r\n\r\nThe logging is different between SDK 9.2.0 and 9.2.1. I just had a crash in my app in the iOS simulator. Logging with SDK 9.2.1 I just get the native log (something like...\r\n[ERROR] -[__NSCFString count]: unrecognized selector sent to instance 0x7f8e2e03a800\r\n[ERROR] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString count]: unrecognized selector sent to instance 0x7f8e2e03a800'\r\n[ERROR] *** First throw call stack:\r\n[ERROR] ( \r\n[ERROR] 0 CoreFoundation 0x00007fff2043a126 __exceptionPreprocess + 242\r\n[ERROR] 1 libobjc.A.dylib 0x00007fff20177f78 objc_exception_throw + 48......\r\n\r\nbut no Ti log so don't know where in my code the issue is. But logging with SDK 9.2.0 I get the Ti log as well:\r\n\r\n[ERROR] Script Error {\r\n[ERROR] column = 27;\r\n[ERROR] line = 175;\r\n[ERROR] message = \"Invalid type passed to function\";\r\n[ERROR] nativeReason = \"expected: TiViewProxy, was: NSNull\";\r\n.......\r\nSo to be clear I'm not asking what the bug is, but why should the logging have changed between SDK 9.2.0 and 9.2.1?", "updateAuthor": { "name": "icecandyent", "key": "icecandyent", "displayName": "Simon Buckingham", "active": true, "timeZone": "Europe/London" }, "created": "2020-10-29T21:06:24.000+0000", "updated": "2020-10-29T21:06:24.000+0000" }, { "id": "457409", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~icecandyent], thanks for reporting, this maybe related to TIMOB-28160. Do you see a second error which includes the actual information about the native exception? If not could you please add a minimal reproducible test case to that ticket so we can double check that?", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-11-02T14:13:54.000+0000", "updated": "2020-11-02T14:13:54.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }