Skip to content

humaidk2/MVCPrepro

Repository files navigation

MVCP / Fabric commit-merge glitch — minimal reproduction

A minimal React Native project reproducing a maintainVisibleContentPosition (MVCP) glitch on Android with the New Architecture (Fabric).

The bug

On Android with the New Architecture, a FlatList using maintainVisibleContentPosition visibly glitches/jumps the entire list when a new item is prepended — but only when list rows have non-trivial content (nested views, multiple Text components, content-driven heights). With a single <View><Text/></View> row the glitch does not occur.

  • Environment: RN 0.85.3, New Architecture enabled, native-stack, Android.
  • Symptom: tap the Add button repeatedly. The whole list jumps/glitches on each insert instead of smoothly preserving scroll position.
  • Not specific to: Reanimated, Gesture Handler, item count, or inverted lists. The glitch correlates with per-row commit/measurement cost.

Bisection findings

  • Plain rows (single View + Text): no glitch at any tested item count.
  • Heavy rows (nested Views, multiple Text): glitches at ~50+ items.
  • Switching to index-based keys removes the glitch (but breaks item identity and insert animations — not a real fix).
  • Removing maintainVisibleContentPosition removes the glitch (but no longer preserves scroll position on insert).
  • Declaring fixed heights via getItemLayout removes the glitch — pointing at shadow-tree measurement during commit as the racing operation.

Suspected root cause

LazyShadowTreeRevisionConsistencyManager::updateCurrentRevision appears to select a stale shadow-tree revision when commits merge during MVCP's scroll position correction. Believed related to RN PR #56513 and the renderer team's skipped Cluster E consistency test.

Related feature flag

  • enableFabricCommitBranching = false (default): insert glitch via the MVCP commit-merge race.
  • enableFabricCommitBranching = true: insert glitch disappears, but a bootsplash flash appears on back navigation (a separate bug in the same shadow-tree consistency code area).

Reproducing

Note: Make sure you have completed the Set Up Your Environment guide first.

From the project root:

npm install
npm run android

When the app launches, repeatedly tap the Add button at the bottom. The list will visibly glitch/jump on each insertion.

Recordings

The glitch is brief at full speed; the slowed-down captures make it obvious.

Normal speed

normal.mp4

10% speed

slow10.mp4

5% speed

slow5.mp4

Learn More

About

This is a mvcp reproduction of a react native bug

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors