deltachat / deltachat-ios

Email-based instant messaging for iOS.
GNU General Public License v3.0
314 stars 49 forks source link

crashe when opening webxdc selector #1901

Closed r10s closed 1 year ago

r10s commented 1 year ago

sometimes there is a crash when opening webxdc selector, i did not find a way to reproduce that reliably, might be related to some race wrt deduplicateWebxdcs()

this is what i got from the debugger:

2023-06-09 11:48:18.027379+0200 deltachat-ios[95805:10650944] *** Assertion failure in -[UICollectionView _Bug_Detected_In_Client_Of_UICollectionView_Invalid_Batch_Updates:], UICollectionView.m:10064
2023-06-09 11:48:18.028724+0200 deltachat-ios[95805:10650944] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid batch updates detected: the number of sections and/or items returned by the data source before and/or after performing the batch updates are inconsistent with the updates.
Data source before updates = { 1 section with item counts: [1] }
Data source after updates = { 1 section with item counts: [1] }
Updates = [
    Insert item (0 - 0)
]
Collection view: <UICollectionView: 0x135a32c00; frame = (0 0; 0 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x134fb4870>; backgroundColor = <UIDynamicProviderColor: 0x134ae6170; provider = <__NSMallocBlock__: 0x134af5f00>>; layer = <CALayer: 0x134f80a90>; contentOffset: {0, 0}; contentSize: {0, 0}; adjustedContentInset: {5, 5, 5, 5}; layout: <deltachat_ios.GridCollectionViewFlowLayout: 0x134f95540>; dataSource: <deltachat_ios.WebxdcSelector: 0x135a48c00>>'
*** First throw call stack:
(0x18dbcad94 0x186c843d0 0x1883796cc 0x190331358 0x18ff3c5ec 0x18fe9b41c 0x18fe9b26c 0x1041c082c 0x104194ba8 0x10540c520 0x10540e038 0x10541e798 0x10541e2dc 0x18dc59d18 0x18dc3b650 0x18dc404dc 0x1c8ea035c 0x18ffcc37c 0x18ffcbfe0 0x10434b250 0x1ad0c8dec)
libc++abi: terminating due to uncaught exception of type NSException
r10s commented 1 year ago

fixed by second commit of https://github.com/deltachat/deltachat-ios/pull/1900