[ASCollectionNode] Scrolling while performing many updates in ASCollectionNode triggers "Couldn't find 'visible' item at index path" assertion #378
Description
Hi, I've asked about this a couple of times in the Slack channel but did not really receive any helpful advice. I am not sure whether this is a bug in Texture or not.
I was investigating a bug leading to a SIGABRT from line 71 in ASInternalHelpers.mm
dispatch_async(dispatch_get_main_queue(), block);
After building Texture with Carthage using --configuration Debug
I started to get a crash in ASCollectionView.mm
on line 1821:
ASDisplayNodeFailAssert(@"Couldn't find 'visible' item at index path %@ in map %@", indexPath, map);
I am pretty confident I'm performing all my datasource and corresponding ASCollectionNode updates correctly.
I have thrown together a project that consistently reproduces the error. It includes all frameworks. AsyncDisplayKit 2.3.3 have been built using Debug configuration.
I am pretty sure the two above issues are linked, but using a Release build of AsyncDisplayKit with the test project, I can't seem to reproduce the first one. However I get it fairly regularly in the App I'm working on. I can't post that code here though.
Link to download project: https://www.dropbox.com/s/96f0403zdq2isdb/ASCollectionNodeCrash.zip?dl=0
NOTE: Scroll around to be sure it crashes!
Project is Swift 4 and needs to be opened in XCode 9, but the error occurred just as frequently before I did the update.