quick scroll by crash
- Dominant language
- Swift
- Stars
- 4.6k
- Forks
- 588
- PR merge metrics
- No merged PRs in 30d
Description
BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore/UIKit-3698.140/UICollectionViewData.m:447
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView received layout attributes for a cell with an index path that does not exist
Thread 0 Crashed:
0 CoreFoundation 0x000000019d5e4cb4 __exceptionPreprocess + [ : 164]
1 libobjc.A.dylib 0x00000001966803d0 objc_exception_throw + [ : 60]
2 Foundation 0x0000000197d7654c _userInfoForFileAndLine
3 UIKitCore 0x000000019fd4c4f4 -[UICollectionView _Bug_Detected_In_Client_Of_UICollectionView_Invalid_Number_Of_Items_In_Section:] + [ : 96]
4 UIKitCore 0x000000019f9575a8 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:] + [ : 9916]
5 UIKitCore 0x000000019f8b541c -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:animationHandler:] + [ : 420]
6 Chatto 0x00000001042b7ea8 closure #3 in BaseChatViewController.performBatchUpdates(updateModelClosure:changes:updateType:completion:) + [ : 492]
7 Chatto 0x00000001042be34c partial apply for closure #3 in BaseChatViewController.performBatchUpdates(updateModelClosure:changes:updateType:completion:) + [ : 40]
8 Chatto 0x00000001042b2778 thunk for @escaping @callee_guaranteed () -> () + [ : 0]
9 UIKitCore 0x000000019f716b20 +[UIView _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + [ : 512]
10 UIKitCore 0x000000019f83c85c +[UIView(UIViewAnimationWithBlocks) animateWithDuration:animations:] + [ : 52]
11 Chatto 0x00000001042bd79c $s6Chatto22BaseChatViewControllerC19performBatchUpdates18updateModelClosure7changes0I4Type10completionyyyc_AA17CollectionChangesVAA06UpdateM0OyyctF011$s6Chatto22bcde129C12updateModels33_612DFD8221191D415C81FF197E016366LL8newItems03oldN00F4Type10completionySayAA0C12ItemProtocol_pG_AA0cR19Companiono5VAA06q14P0OyyctFyAA0U7P16V_yyctcfU_yycfU_ACSgXwz_XxIeg_Tf1nnncn_nTf4nnnngg_n + [ : 0]
12 Chatto 0x00000001042b8450 closure #1 in BaseChatViewController.updateModels(newItems:oldItems:updateType:completion:) + [ : 164]
13 Chatto 0x00000001042be138 partial apply for closure #1 in BaseChatViewController.updateModels(newItems:oldItems:updateType:completion:) + [ : 32]
14 Chatto 0x00000001042be0d0 $s6Chatto22BaseChatViewControllerC12updateModels33_612DFD8221191D415C81FF197E016366LL8newItems03oldN00F4Type10completionySayAA0C12ItemProtocol_pG_AA0cR19CompanionCollectionVAA06UpdateP0OyyctFyycfU1_yyScMYccfU_TA + [ : 0]
15 Chatto 0x00000001042b2778 thunk for @escaping @callee_guaranteed () -> () + [ : 0]

Contributor guide
Research direction
Start by reproducing the crash while quickly scrolling, then inspect BaseChatViewController.performBatchUpdates(updateModelClosure:changes:updateType:completion:) and updateModels(newItems:oldItems:updateType:completion:) from the stack trace. Compare the collection updates with the model changes at the point of failure. Done means the quick-scroll scenario no longer terminates with the UICollectionView invalid index-path exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100