{ "id": "176146", "key": "TIMOB-28415", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2021-11-02T18:59:41.000+0000", "created": "2021-04-11T10:01:07.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "crash", "ios", "modules" ], "versions": [ { "id": "21050", "name": "Release 10.0.0", "archived": false, "released": true, "releaseDate": "2021-05-17" } ], "issuelinks": [ { "id": "59256", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "176152", "key": "TIMOB-28420", "fields": { "summary": "iOS: Unhandled native exceptions invoked via JS should show an error dialog", "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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "59255", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "171778", "key": "TIMOB-26119", "fields": { "summary": "TiAPI: Deprecate getter/setter accessor methods for properties", "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": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-11-02T18:59:41.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": "This took us days to track down: There are crashes related to setters in modules built with SDK 9.x when running in an app with SDK 10. The following selector has been used (accessed via {{via.canDrag = true}}):\r\n{code:objc}\r\n- (void)setCanDrag:(NSNumber *)value\r\n{code}\r\nThe full method can be found [here|https://github.com/hansemannn/titanium-drag-and-drop/blob/master/ios/Classes/TiUIViewProxy%2BDragAndDrop.m#L15-L29].\r\n\r\nThe crash is:\r\n{code}\r\n[DEBUG] -[__NSCFString count]: unrecognized selector sent to instance 0x7f83dc335000\r\n[DEBUG] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString count]: unrecognized selector sent to instance 0x7f83dc335000'\r\n[DEBUG] *** First throw call stack:\r\n[DEBUG] (\r\n[DEBUG] 0 CoreFoundation 0x00007fff20421af6 __exceptionPreprocess + 242\r\n[DEBUG] 1 libobjc.A.dylib 0x00007fff20177e78 objc_exception_throw + 48\r\n[DEBUG] 2 CoreFoundation 0x00007fff204306f7 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0\r\n[DEBUG] 3 CoreFoundation 0x00007fff20426036 ___forwarding___ + 1489\r\n[DEBUG] 4 CoreFoundation 0x00007fff20428068 _CF_forwarding_prep_0 + 120\r\n[DEBUG] 5 TitaniumKit 0x00000001090e19f5 -[TiScriptError formattedNativeStack] + 133\r\n[DEBUG] 6 TitaniumKit 0x00000001090e18fb -[TiScriptError description] + 1127\r\n[DEBUG] 7 Foundation 0x00007fff2084c37a _NSDescriptionWithLocaleFunc + 82\r\n[DEBUG] 8 CoreFoundation 0x00007fff203bae0d __CFStringAppendFormatCore + 12102\r\n[DEBUG] 9 CoreFoundation 0x00007fff203bc8a1 _CFStringCreateWithFormatAndArgumentsReturningMetadata + 145\r\n[DEBUG] 10 CoreFoundation 0x00007fff203bc80a _CFStringCreateWithFormatAndArgumentsAux2 + 20\r\n[DEBUG] 11 TitaniumKit 0x00000001090a3f3d TiLogMessage + 175\r\n[DEBUG] 12 TitaniumKit 0x00000001090e0eb0 -[TiExceptionHandler reportScriptError:] + 74\r\n[DEBUG] 13 TitaniumKit 0x00000001090cdd9e TiBindingEventProcess + 731\r\n[DEBUG] 14 TitaniumKit 0x00000001090ef223 -[KrollContext invoke:] + 109\r\n[DEBUG] 15 TitaniumKit 0x00000001090ef296 -[KrollContext enqueue:] + 93\r\n[DEBUG] 16 TitaniumKit 0x00000001090f6640 TiBindingRunLoopEnqueue + 77\r\n[DEBUG] 17 TitaniumKit 0x00000001090f4d45 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 187\r\n[DEBUG] 18 TitaniumKit 0x00000001090d5b08 -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 224\r\n[DEBUG] 19 TitaniumKit 0x00000001090f4b3b -[TiProxy fireEvent:withObject:propagate:] + 76\r\n[DEBUG] 20 libdispatch.dylib 0x00007fff2010532f _dispatch_call_block_and_release + 12\r\n[DEBUG] 21 libdispatch.dylib 0x00007fff20106508 _dispatch_client_callout + 8\r\n[DEBUG] 22 libdispatch.dylib 0x00007fff20112ff7 _dispatch_main_queue_callback_4CF + 1045\r\n[DEBUG] 23 CoreFoundation 0x00007fff2038fdbb __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9\r\n[DEBUG] 24 CoreFoundation 0x00007fff2038a63e __CFRunLoopRun + 2685\r\n[DEBUG] 25 CoreFoundation 0x00007fff203896d6 CFRunLoopRunSpecific + 567\r\n[DEBUG] 26 GraphicsServices 0x00007fff2c257db3 GSEventRunModal + 139\r\n[DEBUG] 27 UIKitCore 0x00007fff24696cf7 -[UIApplication _run] + 912\r\n[DEBUG] 28 UIKitCore 0x00007fff2469bba8 UIApplicationMain + 101\r\n[DEBUG] 29 Lambus 0x0000000106d8693b main + 1115\r\n[DEBUG] 30 libdyld.dylib 0x00007fff2025a3e9 start + 1\r\n[DEBUG] )\r\n{code}\r\n\r\nThe same works fine with SDK 9.3.2.GA and can be reproduced in our project shared with the team. I created a workaround in my module which can be seen [here|https://github.com/hansemannn/titanium-drag-and-drop/pull/4]", "attachment": [], "flagged": false, "summary": "iOS: KrollBridge no longer exposes \"modules\" method as of 10.0.0", "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": null, "comment": { "comments": [ { "id": "458570", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Can someone please address this? It's causing hundrets of crashes and it could be any module (along with the one already fixed)!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2021-04-13T17:41:35.000+0000", "updated": "2021-04-13T17:41:35.000+0000" }, { "id": "458579", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I have to calm a bit btw: It's still a prerelease :-)", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2021-04-14T15:55:20.000+0000", "updated": "2021-04-14T15:55:20.000+0000" }, { "id": "458581", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "I'm not 100% certain the issue here is with the setter implementations. The underlying stack trace is obscured by our error handling tossing its own error while trying to handle it. I created a local branch and cherry-picked [~jquick]'s fix from https://github.com/appcelerator/titanium_mobile/pull/12721, then created an app, pasted in your module's example code into app.js, and launched its with the v1.0.0 zip on the releases page and a local build of SDK from master (10.1.0). This is what it threw:\r\n\r\n{code}\r\n[ERROR] file:///app.js:33\r\n[ERROR] (null)\r\n[ERROR] ^\r\n[ERROR] : [ valueForUndefinedKey:]: this class is not key value coding-compliant for the key modules.\r\n[ERROR] at initializeDragAndDrop (file:///app.js:33:11)\r\n[ERROR] \r\n[ERROR] ti-example 0x000000010ed03401 +[TiDraganddropModule instance] + 93\r\n[ERROR] ti-example 0x000000010ed02948 -[TiUIViewProxy(DragAndDrop) setCanDrag:] + 155\r\n[ERROR] TitaniumKit0x000000010f040d52 -[KrollObject setValue:forKey:] + 410\r\n[ERROR] TitaniumKit0x000000010f03f3ad KrollSetProperty + 360\r\n[ERROR] JavaScriptCore 0x00007fff30d30919 _ZN3JSC16JSCallbackObjectINS_16JSNonFinalObjectEE3putEPNS_6JSCellEPNS_14JSGlobalObjectENS_12PropertyNameENS_7JSValueERNS_15PutPropertySlotE + 313\r\n[ERROR] JavaScriptCore 0x00007fff31463b13 llint_slow_path_put_by_id + 3203\r\n[ERROR] JavaScriptCore 0x00007fff30ccaf0d llint_entry + 38921\r\n[ERROR] JavaScriptCore 0x00007fff30cc150f vmEntryToJavaScript + 216\r\n[ERROR] JavaScriptCore 0x00007fff3136cda6 _ZN3JSC11Interpreter11executeCallEPNS_14JSGlobalObjectEPNS_8JSObjectERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 518\r\n[ERROR] JavaScriptCore 0x00007fff315bd114 _ZN3JSC12profiledCallEPNS_14JSGlobalObjectENS_15ProfilingReasonENS_7JSValueERKNS_8CallDataES3_RKNS_7ArgListE + 164\r\n[ERROR] JavaScriptCore 0x00007fff30d453d7 JSObjectCallAsFunction + 791\r\n[ERROR] TitaniumKit0x000000010f059a71 TiBindingEventProcess + 686\r\n[ERROR] TitaniumKit0x000000010f07af9f -[KrollContext invoke:] + 109\r\n[ERROR] TitaniumKit0x000000010f07b012 -[KrollContext enqueue:] + 93\r\n[ERROR] TitaniumKit0x000000010f0823eb TiBindingRunLoopEnqueue + 77\r\n[ERROR] TitaniumKit0x000000010f080ac1 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 187\r\n[ERROR] TitaniumKit0x000000010f061808 -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 224\r\n[ERROR] TitaniumKit0x000000010f0808b7 -[TiProxy fireEvent:withObject:propagate:] + 76\r\n{code}\r\n\r\nI think your code to try and access the shared singleton of the module instance is what's causing the issue (specifically https://github.com/hansemannn/titanium-drag-and-drop/blob/master/ios/Classes/TiDraganddropModule.m#L90-L94 ) - and it's to be expected, because KrollBridge does not have a {{modules}} property anymore. You were relying on some real internal knowledge there.\r\n\r\nCan you modify the module's init method to assign to some static singleton variable that the {{instance}} method could then return?", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-04-14T17:07:41.000+0000", "updated": "2021-04-14T17:07:41.000+0000" }, { "id": "458582", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I did [this pull request|https://github.com/hansemannn/titanium-drag-and-drop/pull/4/files] to workaround the issues, in detail:\r\n- The \"setCanDrag\" and \"setCanDrop\" were property accessors (for \"view.canDrag = true\" and \"view.canDrop\"). If I leave it as-is, the methods could not be called - I'm not 100 % sure anymore if it was the setter in general or the underlaying \"ENSURE_UI_THREAD\". Therefore the PR did a bit more:\r\n\r\n- Move from setter to \"real\" method\r\n- Move from ENSURE_UI_THREAD to \"TiThreadPerformOnMainThread\" (incl. proper weak-selfs)\r\n- Move from {{\\[TiApp.app.krollBridge valueForKey:@\"modules\"\\]}} to {{\\[TiApp.app valueForKey:@\"modules\"\\]}} which (I hope) stays as-is for a while. I noticed that the naming of the module keys also changed from the identifier to the native class name (\"ti.draganddrop\" to \"TiDraganddropModule\")\r\n\r\nSo to conclude, maybe I was testing with an old build for the setters, but I was pretty sure they haven't been called at all. Together with TIMOB-28419, I think we're running stable right now. So we could close this ticket for now and keep an eye on module compatibility.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2021-04-14T17:20:28.000+0000", "updated": "2021-04-14T17:20:49.000+0000" }, { "id": "458583", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Testing with v1.0.0 against master branch, I generated this patch PR: https://github.com/appcelerator/titanium_mobile/pull/12724\r\n\r\nThose changes seem to be enough for the example app to work. (Though I should note that the drop event listener being {{console.warn}} unbound did trigger an error. I had to change it to add the event listener as {{console.warn.bind(console)}})\r\n\r\nSo I don't think the setters are broken at all here.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-04-14T18:01:47.000+0000", "updated": "2021-04-14T18:05:47.000+0000" }, { "id": "458585", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/12724", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-04-14T18:05:01.000+0000", "updated": "2021-04-14T18:05:01.000+0000" }, { "id": "459148", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The following PR replaces the above PR. It adds review feedback and solves conflicts.\r\n\r\nPR (master): https://github.com/appcelerator/titanium_mobile/pull/13161", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-11-02T02:41:24.000+0000", "updated": "2021-11-02T02:41:24.000+0000" }, { "id": "459151", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as \"invalid\".\r\nWe agreed that this is an undocumented API that should not be depended on.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-11-02T18:59:14.000+0000", "updated": "2021-11-02T18:59:14.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }