TextureGroup / Texture

Smooth asynchronous user interfaces for iOS apps.
https://texturegroup.org/
Other
8.02k stars 1.29k forks source link

NSInternalInconsistencyException (Invalid number of rows) triggered in requeryNodeHeights #1996

Open savan0714 opened 3 years ago

savan0714 commented 3 years ago

Texture: 3.0.0 iOS: 11 to 14 (80% in iOS 12)

Sometimes while inserting/reloading table node NSInternalInconsistencyException is triggered from requeryNodeHeights with below message.

Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (0) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).

Below is the stack trace.

0  CoreFoundation                 0x1ffb4f180 __exceptionPreprocess
1  libobjc.A.dylib                0x1fed279f8 objc_exception_throw
2  CoreFoundation                 0x1ffa6888c +[_CFXNotificationTokenRegistration keyCallbacks]
3  Foundation                     0x20052cb38 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4  UIKitCore                      0x22c70ac78 -[UITableView _endCellAnimationsWithContext:]
5  UIKitCore                      0x22c7210c8 -[UITableView endUpdates]
6  AsyncDisplayKit                0x101a191c0 -[ASTableView requeryNodeHeights] + 1947 (ASTableView.mm:1947)
7  AsyncDisplayKit                0x101a13114 -[ASTableView layoutSubviews] + 775 (ASTableView.mm:775)
8  UIKitCore                      0x22c9b9170 -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
9  QuartzCore                     0x20408cc60 -[CALayer layoutSublayers]
10 AsyncDisplayKit                0x101979688 -[_ASDisplayLayer layoutSublayers] + 83 (_ASDisplayLayer.mm:83)
11 QuartzCore                     0x204091c08 CA::Layer::layout_if_needed(CA::Transaction*)
12 QuartzCore                     0x20408cb7c -[CALayer layoutIfNeeded]
13 AsyncDisplayKit                0x1019c9904 -[ASDisplayNode _recursivelyTriggerDisplayAndBlock:] + 1432 (ASDisplayNode.mm:1432)
14 AsyncDisplayKit                0x1019c9128 __49+[ASDisplayNode scheduleNodeForRecursiveDisplay:]_block_invoke_2 + 1293 (ASDisplayNode.mm:1293)
15 AsyncDisplayKit                0x101a05afc -[ASRunLoopQueue processQueue] + 1480 (iterator:1480)
16 CoreFoundation                 0x1ffae04fc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
17 CoreFoundation                 0x1ffadb224 __CFRunLoopDoObservers
18 CoreFoundation                 0x1ffadb7a0 __CFRunLoopRun
19 CoreFoundation                 0x1ffadafb4 CFRunLoopRunSpecific
20 GraphicsServices               0x201cdc79c GSEventRunModal
21 UIKitCore                      0x22c521c38 UIApplicationMain
22 TextureTest                      0x10029b058 main + 16 (PreferenceManager.swift:16)
23 libdyld.dylib                  0x1ff59e8e0 start

Same issue #2472 was raised long time back on AsyncDisplayKit repo.

Do let me know if anything is required from my side.

vj1988 commented 3 years ago

Facing the same issue. Not able to figure out a fix for a long time.

mohitdb7 commented 3 years ago

Facing the same issue in iOS 14 and below, not able to figure out the root cause

gnshkamath commented 3 years ago

I had posted regarding the same issue in the Texture Slack workspace long back, but didn't get an answer. It would be helpful if we get some insights on this issue.