badoo / badoo/Chatto

performBatchUpdates.crash

Open
#486 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
4.6k
Forks
588
PR merge metrics
No merged PRs in 30d

Description

Crash from AppStore. Maybe you can help me to understand what happened. I use Text and Photo messages.

```
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0

Last Exception Backtrace:
0 CoreFoundation 0x18514ed8c __exceptionPreprocess + 228 (NSException.m:166)
1 libobjc.A.dylib 0x1843085ec objc_exception_throw + 56 (objc-exception.mm:521)
2 CoreFoundation 0x18514ebf8 +[NSException raise:format:arguments:] + 104 (NSException.m:132)
3 Foundation 0x185b3efa0 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112 (NSException.m:157)
4 UIKit 0x18ee69db8 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:] + 12908 (UICollectionView.m:6031)
5 UIKit 0x18ee66b38 -[UICollectionView _endUpdatesWithInvalidationContext:tentativelyForReordering:animator:] + 92 (UICollectionView.m:6892)
6 UIKit 0x18ee65cc4 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:] + 388 (UICollectionView.m:6950)
7 UIKit 0x18ee65b20 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:] + 96 (UICollectionView.m:6914)
8 UIKit 0x18ee65aa4 -[UICollectionView _performBatchUpdates:completion:invalidationContext:] + 84 (UICollectionView.m:6909)
9 UIKit 0x18ee65a3c -[UICollectionView performBatchUpdates:completion:] + 64 (UICollectionView.m:6898)
10 Chatto 0x1011c8a9c closure #3 in BaseChatViewController.performBatchUpdates(updateModelClosure:changes:updateType:completion:) + 484 (BaseChatViewController+Changes.swift:191)
11 Chatto 0x1011d3534 thunk for @escaping @callee_guaranteed () -> () + 36 (BaseChatViewController+Scrolling.swift:0)
12 UIKit 0x18ed173d4 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 608 (UIView.m:12443)
13 UIKit 0x18ee01090 +[UIView(UIViewAnimationWithBlocks) animateWithDuration:animations:] + 60 (UIView.m:12512)
14 Chatto 0x1011ce688 specialized BaseChatViewController.performBatchUpdates(updateModelClosure:changes:updateType:completion:) + 2932 (BaseChatViewController+Changes.swift:189)
15 Chatto 0x1011c94c4 closure #1 in BaseChatViewController.updateModels(newItems:oldItems:updateType:completion:) + 204 (BaseChatViewController+Changes.swift:0)
16 Chatto 0x1011cf460 partial apply for closure #1 in BaseChatViewController.updateModels(newItems:oldItems:updateType:completion:) + 32 (BaseChatViewController+Changes.swift:0)
17 Chatto 0x1011c975c closure #1 in closure #3 in BaseChatViewController.updateModels(newItems:oldItems:updateType:completion:) + 136 (BaseChatViewController+Changes.swift:257)
18 Chatto 0x1011cfd58 partial apply for closure #1 in closure #3 in BaseChatViewController.updateModels(newItems:oldItems:updateType:completion:) + 44 (BaseChatViewController+Changes.swift:0)
19 Chatto 0x1011d3534 thunk for @escaping @callee_guaranteed () -> () + 36 (BaseChatViewController+Scrolling.swift:0)
20 libdispatch.dylib 0x184a40b24 _dispatch_call_block_and_release + 24 (init.c:994)
21 libdispatch.dylib 0x184a40ae4 _dispatch_client_callout + 16 (object.m:507)
22 libdispatch.dylib 0x184a4d6e0 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1012 (inline_internal.h:2500)
23 CoreFoundation 0x1850f7070 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1815)
24 CoreFoundation 0x1850f4bc8 __CFRunLoopRun + 2272 (CFRunLoop.c:3111)
25 CoreFoundation 0x185014da8 CFRunLoopRunSpecific + 552 (CFRunLoop.c:3245)
26 GraphicsServices 0x186ff7020 GSEventRunModal + 100 (GSEvent.c:2245)
27 UIKit 0x18eff578c UIApplicationMain + 236 (UIApplication.m:3965)
```

Contributor guide

Open the contributing guide

Research direction

Start by reviewing BaseChatViewController+Changes.swift, especially performBatchUpdates at lines 189 and 191 and updateModels around line 257. Reproduce the crash with Text and Photo messages, then determine the failing batch-update condition and verify that the same scenario no longer crashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.