Skip to content

cellNode(at: indexPath) Fatal error: Index out of range #78

@Fabezi

Description

@Fabezi

Checklist

Expected Behavior

Should not crash

Current Behavior

Rapid updates between these two type of reload methods cause datasource to be inconsistent
https://github.com/ra1028/Carbon/blob/master/Sources/Updaters/UICollectionViewUpdater.swift#L59-L64
https://github.com/ra1028/Carbon/blob/master/Sources/Updaters/UICollectionViewUpdater.swift#L70-L75

and will sometimes, very rarely, cause cellNode(at: indexPath) below to throw an fatal arror
https://github.com/ra1028/Carbon/blob/master/Sources/Updaters/UICollectionViewUpdater.swift#L168

Steps to Reproduce

Attached simple example project. You may have to run it a few times.
CarbonCrash.zip

Screenshot 2020-10-29 at 21 45 39

Environments

  • Carbon version: Master
  • Swift version: 5.3
  • iOS version: 14.1
  • Xcode version: 12
  • Devices/Simulators: All
  • CocoaPods/Carthage version: SPM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions