{ "id": "170539", "key": "TIMOB-25586", "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": [ { "id": "19988", "description": "", "name": "Release 7.0.1", "archived": false, "released": true, "releaseDate": "2017-12-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-12-15T21:09:35.000+0000", "created": "2017-12-05T09:40:56.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "filtered", "row", "searchBar" ], "versions": [ { "id": "19906", "description": "", "name": "Release 6.3.0", "archived": false, "released": true, "releaseDate": "2017-11-01" } ], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-06T17:49:29.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": "Hi, i have a problem with selecting a filtered row in a tableview. \r\nThe app crashes, when i try to change the background color of the clicked row.\r\nThis happens only when in tiapp.xml run-on-main-thread is set to true.\r\nExample (Just click on a filtered row):\r\n\r\nTi.UI.backgroundColor = 'white';\r\nvar win = Ti.UI.createWindow();\r\nvar view = Titanium.UI.createView({\r\n\t\ttop:30,\r\n\t\twidth:400,\r\n\t\tleft:150,\r\n});\r\nvar oldRow;\r\nvar tableData = [ {title: 'Apples'}, {title: 'Bananas'}, {title: 'Carrots'}, {title: 'Potatoes'} ];\r\nvar searchBar = Titanium.UI.createSearchBar({\r\n\t\t\tshowCancel:true,\t\r\n});\r\nvar table = Ti.UI.createTableView({\r\n data: tableData,\r\n search:searchBar,\r\n width:300, \r\n hideSearchOnSelection:false\r\n});\r\n\r\ntable.addEventListener('click', function(e) {\r\n\t\tif (oldRow != null)\r\n\t\t\toldRow.backgroundColor = 'white';\r\n\t\te.row.backgroundColor = '#E6E6E6';\t\r\n\t\toldRow = e.row;\r\n});\t\r\nview.add(table);\r\nwin.add(view);\r\nwin.open();\r\n\r\n[ERROR] : The application has crashed with an uncaught exception 'NSInternalInconsistencyException'.\r\n[ERROR] : Reason:\r\n[ERROR] : attempt to insert row 3 into section 0, but there are only 2 rows in section 0 after the update\r\n[ERROR] : Stack trace:\r\n[ERROR] : 0 CoreFoundation 0x0000000114653193 __exceptionPreprocess + 147\r\n[ERROR] : 1 libobjc.A.dylib 0x0000000113720f41 objc_exception_throw + 48\r\n[ERROR] : 2 CoreFoundation 0x0000000114658372 +[NSException raise:format:arguments:] + 98\r\n[ERROR] : 3 Foundation 0x000000010df8c089 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193\r\n[ERROR] : 4 UIKit 0x000000010e62ded7 -[UITableView _endCellAnimationsWithContext:] + 9203\r\n[ERROR] : 5 UIKit 0x000000010e64c2e4 -[UITableView _updateRowsAtIndexPaths:withUpdateAction:rowAnimation:usingPresentationValues:] + 1342\r\n[ERROR] : 6 UIKit 0x000000010e64c69d -[UITableView reloadRowsAtIndexPaths:withRowAnimation:] + 133\r\n[ERROR] : 7 test 0x000000010c460463 -[TiUITableView dispatchAction:] + 771\r\n[ERROR] : 8 test 0x000000010c520341 -[TiUITableViewRowProxy updateRow:] + 97\r\n[ERROR] : 9 test 0x000000010c5204da __41-[TiUITableViewRowProxy triggerRowUpdate]_block_invoke + 42\r\n[ERROR] : 10 libdispatch.dylib 0x00000001178f7273 _dispatch_call_block_and_release + 12\r\n[ERROR] : 11 libdispatch.dylib 0x00000001178f82b5 _dispatch_client_callout + 8\r\n[ERROR] : 12 libdispatch.dylib 0x0000000117902496 _dispatch_main_queue_callback_4CF + 1260\r\n[ERROR] : 13 CoreFoundation 0x0000000114615ee9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9\r\n[ERROR] : 14 CoreFoundation 0x00000001145da592 __CFRunLoopRun + 2402\r\n[ERROR] : 15 CoreFoundation 0x00000001145d99b9 CFRunLoopRunSpecific + 409\r\n[ERROR] : 16 GraphicsServices 0x00000001163d09c6 GSEventRunModal + 62\r\n[ERROR] : 17 UIKit 0x000000010e50d5e8 UIApplicationMain + 159\r\n[ERROR] : 18 test 0x000000010c3bed54 main + 100\r\n[ERROR] : 19 libdyld.dylib 0x000000011796cd81 start + 1\r\n[ERROR] : 20 ??? 0x0000000000000001 0x0 + 1\r\n-- End simulator log ---------------------------------------------------------\r\n\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "iOS: Crash when selecting filtered row in Ti.UI.SearchBar", "creator": { "name": "mlandeck", "key": "mlandeck", "displayName": "Michael Landeck", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mlandeck", "key": "mlandeck", "displayName": "Michael Landeck", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.13.1\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 17179869184\r\nNode.js\r\n Node.js Version = 6.10.0\r\n npm Version = 3.10.10\r\nTitanium CLI\r\n CLI Version = 5.0.14\r\nTitanium SDK\r\n SDK Version = 6.3.0.GA\r\n SDK Path = /Users/ml/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.GA\r\n Target Platform = iphone", "comment": { "comments": [ { "id": "431745", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I wasn't able to reproduce the issue with the sample code you have provided. I Run on SDK 6.3.0.GA and setting run on the main thread to true in tiapp.xml. I don't see the crash happening when I click on a table view row. The selected row background color does change. I am sending a screenshot of that [screenshot|https://ibb.co/mZocCw]. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-12-05T20:05:38.000+0000", "updated": "2017-12-05T20:05:38.000+0000" }, { "id": "431773", "author": { "name": "mlandeck", "key": "mlandeck", "displayName": "Michael Landeck", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Sharif, please type something into the searchbar to filter the rows, clicking on a filtered row\r\ncauses the error.\r\nThank you", "updateAuthor": { "name": "mlandeck", "key": "mlandeck", "displayName": "Michael Landeck", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-06T08:11:25.000+0000", "updated": "2017-12-06T08:11:25.000+0000" }, { "id": "431836", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "We changed the underlaying API of the SearchBar API in 6.3.0, but some cases have not made it into the GA. Those are included in 7.0.0 which will be published this week. You can try out the final version already using {{appc ti sdk install -b 7_0_X}}. We will still validate if it fixes your issue as well and provide a PR if it doesn't. ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-12-07T10:02:18.000+0000", "updated": "2017-12-07T10:02:18.000+0000" }, { "id": "432021", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test Case (Other than mentioned in ticket):\r\nPR (master) : https://github.com/appcelerator/titanium_mobile/pull/9677\r\n\r\n\r\n{code:java}\r\nTi.UI.backgroundColor = 'white';\r\nvar win = Ti.UI.createWindow();\r\nvar view = Titanium.UI.createView({\r\n top:30,\r\n width:400,\r\n left:10,\r\n});\r\nvar oldRow;\r\nvar tableData = [ {title: 'Change Row Height to 100'}, {title: 'Change Row Color to Blue'}, {title: 'Delete Row'}, \r\n{title: 'Insert Row Before This Row'}, {title: 'Insert Row After This Row'}, {title : 'Update This Row'}, \r\n{title : 'Append Row'}, {title : 'Set New Data to TableView'}];\r\n\r\nvar sectionUpdate = Ti.UI.createTableViewSection({ headerTitle: 'Update Rows proeprties' });\r\nsectionUpdate.add(Ti.UI.createTableViewRow({ title: 'Change Row Height to 100' }));\r\nsectionUpdate.add(Ti.UI.createTableViewRow({ title: 'Change Row Color to Blue' }));\r\n\r\nvar sectionInsert = Ti.UI.createTableViewSection({ headerTitle: 'Insert/Delete rows' });\r\nsectionInsert.add(Ti.UI.createTableViewRow({ title: 'Delete Row' }));\r\nsectionInsert.add(Ti.UI.createTableViewRow({ title: 'Insert Row Before This Row' }));\r\n\r\nvar tableDataNew = [sectionUpdate, sectionInsert];\r\n\r\nvar searchBar = Titanium.UI.createSearchBar({\r\n showCancel:true, \r\n});\r\nvar table = Ti.UI.createTableView({\r\n data: tableData,\r\n search:searchBar,\r\n width:300, \r\n hideSearchOnSelection:false,\r\n});\r\n\r\ntable.addEventListener('click', function(e) {\r\n if (e.row.title == 'Change Row Height to 100') {\r\n e.row.setHeight(100);\r\n } else if (e.row.title == 'Change Row Color to Blue') {\r\n e.row.backgroundColor = 'blue';\r\n } else if (e.row.title == 'Delete Row') {\r\n table.deleteRow(e.row);\r\n } else if (e.row.title == 'Insert Row Before This Row') {\r\n var row = Ti.UI.createTableViewRow({title : 'Row Inserted Before'});\r\n table.insertRowBefore(e.index, row);\r\n } else if (e.row.title == 'Insert Row After This Row') {\r\n var row = Ti.UI.createTableViewRow({title : 'Row Inserted After'});\r\n table.insertRowAfter(e.index, row);\r\n } else if (e.row.title == 'Update This Row') {\r\n var row = Ti.UI.createTableViewRow({title : 'Updated Row'});\r\n table.updateRow(e.index, row);\r\n } else if (e.row.title == 'Append Row') {\r\n var row = Ti.UI.createTableViewRow({title : 'Appended Row'});\r\n table.appendRow(row);\r\n } else if (e.row.title == 'Set New Data to TableView') {\r\n table.setData(tableDataNew);\r\n } \r\n}); \r\nview.add(table);\r\nwin.add(view);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-12T10:10:05.000+0000", "updated": "2017-12-13T00:41:57.000+0000" }, { "id": "432023", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~vijaysingh] Can you please do a 7_0_X backport as well? Also, could this be an issue for Ti.UI.ListView as well?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-12-12T10:35:36.000+0000", "updated": "2017-12-12T10:36:10.000+0000" }, { "id": "432067", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (7_0_X) : https://github.com/appcelerator/titanium_mobile/pull/9680", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-13T01:19:13.000+0000", "updated": "2017-12-13T01:19:13.000+0000" }, { "id": "432183", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. Crash no longer occurs when selecting a filtered row. Verified on both tableView and listView", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-12-14T19:56:13.000+0000", "updated": "2017-12-14T19:56:13.000+0000" }, { "id": "440186", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:49:29.000+0000", "updated": "2018-08-06T17:49:29.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }