{ "id": "164162", "key": "TIMOB-24067", "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": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-03-09T19:19:58.000+0000", "created": "2016-10-24T11:32:52.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-6.1.0" ], "versions": [ { "id": "18322", "name": "Release 5.5.1", "archived": false, "released": true, "releaseDate": "2016-09-28" } ], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-29T15:08:50.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": "To see this issue, run this code:\r\n\r\n\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: '#fff'\r\n});\r\n\r\nvar myTemplate = {\r\n\tproperties: {\r\n\t\tcanEdit: true\r\n\t},\r\n\tchildTemplates: [{\r\n\t\ttype: 'Ti.UI.Label',\r\n\t\tbindId: 'info',\r\n\t\tproperties: {\r\n\t\t\tcolor: '#000',\r\n\t\t\tleft: 60,\r\n\t\t\ttop: 0\r\n\t\t}\r\n\t}]\r\n};\r\n\r\nvar listView = Ti.UI.createListView({\r\n\ttop: 20,\r\n\tbottom: 0,\r\n\ttemplates: {\r\n\t\t'template': myTemplate\r\n\t},\r\n\tpruneSectionsOnEdit: true,\r\n\tdefaultItemTemplate: 'template'\r\n});\r\n\r\nvar sections = [];\r\n\r\nvar fruitSection = Ti.UI.createListSection({\r\n\theaderTitle: 'Fruits'\r\n});\r\nvar fruitDataSet = [{\r\n\tinfo: {\r\n\t\ttext: 'Apple'\r\n\t}\r\n}, {\r\n\tinfo: {\r\n\t\ttext: 'Banana'\r\n\t}\r\n}];\r\nfruitSection.setItems(fruitDataSet);\r\nsections.push(fruitSection);\r\n\r\nlistView.setSections(sections);\r\nwin.add(listView);\r\nwin.open();\r\n{code}\r\n\r\nThen swipe list view row to left to get \"Delete\" option. Press \"Delete\" to delete row.\r\nDelete both rows.\r\n\r\nAfter last row has been deleted, app crashes.\r\n\r\nHere's crash log:\r\n\r\n{code}\r\n[ERROR] The application has crashed with an uncaught exception 'NSInternalInconsistencyException'.\r\n[ERROR] Reason:\r\n[ERROR] attempt to insert section 0 but there are only 0 sections after the update\r\n[ERROR] Stack trace:\r\n[ERROR] \r\n[ERROR] 0 CoreFoundation 0x067d01f0 __exceptionPreprocess + 160\r\n[ERROR] 1 libobjc.A.dylib 0x05e45e66 objc_exception_throw + 52\r\n[ERROR] 2 CoreFoundation 0x067d4332 +[NSException raise:format:arguments:] + 130\r\n[ERROR] 3 Foundation 0x018ce3c4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 94\r\n[ERROR] 4 UIKit 0x01e52b7b -[UITableView _endCellAnimationsWithContext:] + 11060\r\n[ERROR] 5 UIKit 0x01e6d4bd -[UITableView endUpdatesWithContext:] + 49\r\n[ERROR] 6 UIKit 0x01e6d4e1 -[UITableView endUpdates] + 31\r\n[ERROR] 7 Test2 0x002ea9eb -[TiUIListView tableView:commitEditingStyle:forRowAtIndexPath:] + 1611\r\n[ERROR] 8 UIKit 0x01e897d0 -[UITableView _animateDeletionOfRowWithCell:] + 192\r\n[ERROR] 9 UIKit 0x01e5a4c3 __52-[UITableView _swipeActionButtonsForRowAtIndexPath:]_block_invoke + 99\r\n[ERROR] 10 UIKit 0x01e8aff5 -[UITableView _actionButton:pushedInCell:] + 206\r\n[ERROR] 11 UIKit 0x02128069 -[UITableViewCell _actionButtonPushed:] + 90\r\n[ERROR] 12 libobjc.A.dylib 0x05e5b200 -[NSObject performSelector:withObject:withObject:] + 63\r\n[ERROR] 13 UIKit 0x01cf581e -[UIApplication sendAction:to:from:forEvent:] + 91\r\n[ERROR] 14 UIKit 0x01cf57b8 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 41\r\n[ERROR] 15 UIKit 0x01ea432b -[UIControl sendAction:to:forEvent:] + 64\r\n[ERROR] 16 UIKit 0x01ea4693 -[UIControl _sendActionsForEvents:withEvent:] + 462\r\n[ERROR] 17 UIKit 0x01ea3518 -[UIControl touchesEnded:withEvent:] + 717\r\n[ERROR] 18 UIKit 0x022a4d8b _UIGestureEnvironmentSortAndSendDelayedTouches + 6131\r\n[ERROR] 19 UIKit 0x0229f32e _UIGestureEnvironmentUpdate + 1539\r\n[ERROR] 20 UIKit 0x0229ece3 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 494\r\n[ERROR] 21 UIKit 0x0229de8d -[UIGestureEnvironment _updateGesturesForEvent:window:] + 259\r\n[ERROR] 22 UIKit 0x01d6d7c3 -[UIWindow sendEvent:] + 4276\r\n[ERROR] 23 UIKit 0x01d14198 -[UIApplication sendEvent:] + 395\r\n[ERROR] 24 UIKit 0x025bb6cd __dispatchPreprocessedEventFromEventQueue + 3706\r\n[ERROR] 25 UIKit 0x025b37af __handleEventQueue + 5345\r\n[ERROR] 26 CoreFoundation 0x0676fcbf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15\r\n[ERROR] 27 CoreFoundation 0x06753df7 __CFRunLoopDoSources0 + 519\r\n[ERROR] 28 CoreFoundation 0x06753284 __CFRunLoopRun + 1124\r\n[ERROR] 29 CoreFoundation 0x06752bab CFRunLoopRunSpecific + 395\r\n[ERROR] 30 CoreFoundation 0x06752a0b CFRunLoopRunInMode + 123\r\n[ERROR] 31 GraphicsServices 0x07796b4c GSEventRunModal + 177\r\n[ERROR] 32 GraphicsServices 0x077969c7 GSEventRun + 80\r\n[ERROR] 33 UIKit 0x01cf37fb UIApplicationMain + 148\r\n[ERROR] 34 Test2 0x0000a2e8 main + 408\r\n[ERROR] 35 libdyld.dylib 0x08ceb799 start + 1\r\n[ERROR] \r\n[ERROR] 2016-10-24 13:26:36.594 Test2[73649:6482265] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to insert section 0 but there are only 0 sections after the update'\r\n[ERROR] *** First throw call stack:\r\n[ERROR] ( \r\n[ERROR] 0 CoreFoundation 0x067d0212 __exceptionPreprocess + 194\r\n[ERROR] 1 libobjc.A.dylib 0x05e45e66 objc_exception_throw + 52\r\n[ERROR] 2 CoreFoundation 0x067d4332 +[NSException raise:format:arguments:] + 130\r\n[ERROR] 3 Foundation 0x018ce3c4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 94\r\n[ERROR] 4 UIKit 0x01e52b7b -[UITableView _endCellAnimationsWithContext:] + 11060\r\n[ERROR] 5 UIKit 0x01e6d4bd -[UITableView endUpdatesWithContext:] + 49\r\n[ERROR] 6 UIKit 0x01e6d4e1 -[UITableView endUpdates] + 31\r\n[ERROR] 7 Test2 0x002ea9eb -[TiUIListView tableView:commitEditingStyle:forRowAtIndexPath:] + 1611\r\n[ERROR] 8 UIKit 0x01e897d0 -[UITableView _animateDeletionOfRowWithCell:] + 192\r\n[ERROR] 9 UIKit 0x01e5a4c3 __52-[UITableView _swipeActionButtonsForRowAtIndexPath:]_block_invoke + 99\r\n[ERROR] 10 UIKit 0x01e8aff5 -[UITableView _actionButton:pushedInCell:] + 206\r\n[ERROR] 11 UIKit 0x02128069 -[UITableViewCell _actionButtonPushed:] + 90\r\n[ERROR] 12 libobjc.A.dylib 0x05e5b200 -[NSObject performSelector:withObject:withObject:] + 63\r\n[ERROR] 13 UIKit 0x01cf581e -[UIApplication sendAction:to:from:forEvent:] + 91\r\n[ERROR] 14 UIKit 0x01cf57b8 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 41\r\n[ERROR] 15 UIKit 0x01ea432b -[UIControl sendAction:to:forEvent:] + 64\r\n[ERROR] 16 UIKit 0x01ea4693 -[UIControl _sendActionsForEvents:withEvent:] + 462\r\n[ERROR] 17 UIKit 0x01ea3518 -[UIControl touchesEnded:withEvent:] + 717\r\n[ERROR] 18 UIKit 0x022a4d8b _UIGestureEnvironmentSortAndSendDelayedTouches + 6131\r\n[ERROR] 19 UIKit 0x0229f32e _UIGestureEnvironmentUpdate + 1539\r\n[ERROR] 20 UIKit 0x0229ece3 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 494\r\n[ERROR] 21 UIKit 0x0229de8d -[UIGestureEnvironment _updateGesturesForEvent:window:] + 259\r\n[ERROR] 22 UIKit 0x01d6d7c3 -[UIWindow sendEvent:] + 4276\r\n[ERROR] 23 UIKit 0x01d14198 -[UIApplication sendEvent:] + 395\r\n[ERROR] 24 UIKit 0x025bb6cd __dispatchPreprocessedEventFromEventQueue + 3706\r\n[ERROR] 25 UIKit 0x025b37af __handleEventQueue + 5345\r\n[ERROR] 26 CoreFoundation 0x0676fcbf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15\r\n[ERROR] 27 CoreFoundation 0x06753df7 __CFRunLoopDoSources0 + 519\r\n[ERROR] 28 CoreFoundation 0x06753284 __CFRunLoopRun + 1124\r\n[ERROR] 29 CoreFoundation 0x06752bab CFRunLoopRunSpecific + 395\r\n[ERROR] 30 CoreFoundation 0x06752a0b CFRunLoopRunInMode + 123\r\n[ERROR] 31 GraphicsServices 0x07796b4c GSEventRunModal + 177\r\n[ERROR] 32 GraphicsServices 0x077969c7 GSEventRun + 80\r\n[ERROR] 33 UIKit 0x01cf37fb UIApplicationMain + 148\r\n[ERROR] 34 Test2 0x0000a2e8 main + 408\r\n[ERROR] 35 libdyld.dylib 0x08ceb799 start + 1\r\n[ERROR] ) \r\n[ERROR] libc++abi.dylib: terminating with uncaught exception of type NSException\r\n\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: List view crash when deleting rows with \"pruneSectionsOnEdit\" set", "creator": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "* macOS Sierra\r\n* XCode 8\r\n* iOS 10.0.2\r\n* Ti SDK 5.5.1.GA\r\n* AppC CLI 5.5.1", "closedSprints": [ { "id": 847, "state": "closed", "name": "2017 Sprint 05 SDK", "startDate": "2017-02-26T17:39:21.095Z", "endDate": "2017-03-12T17:39:00.000Z", "completeDate": "2017-03-12T19:14:38.838Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "399663", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Is this a regression from 5.4.x to 5.5.x?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-24T12:30:11.000+0000", "updated": "2016-10-24T12:30:11.000+0000" }, { "id": "399664", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "No, I think it happened with 5.3.0.GA also.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-10-24T12:32:16.000+0000", "updated": "2016-10-24T12:32:16.000+0000" }, { "id": "399666", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Replacing [this line|https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUIListView.m#L1135] with {{[tableView deleteSections:theSet withRowAnimation:UITableViewRowAnimationFade];}} fixes the crash, but I'm curious why we used the other method instead. The index in the \"delete\" event is still correct, but we should investigate this further before doing a PR.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-24T12:59:27.000+0000", "updated": "2016-10-24T13:00:11.000+0000" }, { "id": "410273", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR : https://github.com/appcelerator/titanium_mobile/pull/8870", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T11:24:09.000+0000", "updated": "2017-03-09T11:24:09.000+0000" }, { "id": "416141", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "\r\n\r\n{noformat}\r\nMac OS Version : 10.12.3\r\nXcode Version : Xcode 8.2 Build version 8C38\r\nAppc CLI : 6.1.0\r\nAppc NPM : 4.2.9-1\r\nNode : v4.6.0\r\nDevice: iPhone 6 (10.2.1) iPhone 5 (9.3.5)\r\n{noformat}\r\n\r\nUsing above env passed FR. After merge, the changes are present in SDK {{6.1.0.v20170328172120}}.\r\n*Closing*", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2017-03-29T15:08:00.000+0000", "updated": "2017-03-29T15:08:00.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }