Repository navigation
Merge synchronous props queued for an unmounted view with newer updates - #60487
Merged
Merged
Conversation
Summary: When a synchronous (native-driven animated) props update arrives for a view that doesn't exist yet, `FabricUIManager` queues it behind the pending mount items. The view can mount and get a newer synchronous update applied directly before the queued one runs, for example when a view command focuses the new view and fires an event that drives native animated props. The queued update then puts the older props back on the view and stores them as its synchronous mount props override, which also beats the next Fabric commit, so the view keeps the stale values: text that should change color on focus stays in its unfocused color. Synchronous props for a view that doesn't exist yet now merge into one pending map per view (`PendingSynchronousProps`): a newer value wins, and a newer `null` still resets the prop. Each pending update queues a mount item behind the pending mount items, and only the newest one applies the merged props, so they also wait for mount items queued in between, such as the one that creates the view. An update applied directly while props are pending applies them merged with its own and clears them. `synchronouslyUpdateViewOnUIThread` and the batched path (`synchronouslyUpdateViewBatch`) both go through it; the batched path still looks each view up once unless props are pending for it. Changelog: [Android][Fixed] - Fix a stale queued animated props update overwriting a newer one when a view mounts and updates in the same frame Reviewed By: zeyap Differential Revision: D132802978
|
@bumjung has exported this pull request. If you are a Meta employee, you can view the originating Diff in D132802978. |
zeyap
approved these changes
Dec 2, 2026
zeyap
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Contributor
Collaborator
|
This pull request was successfully merged by @bumjung in afe2bf8 When will my fix make it into a release? | How to file a pick request? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
When a synchronous (native-driven animated) props update arrives for a view that doesn't exist yet,
FabricUIManagerqueues it behind the pending mount items. The view can mount and get a newer synchronous update applied directly before the queued one runs, for example when a view command focuses the new view and fires an event that drives native animated props. The queued update then puts the older props back on the view and stores them as its synchronous mount props override, which also beats the next Fabric commit, so the view keeps the stale values: text that should change color on focus stays in its unfocused color.Synchronous props for a view that doesn't exist yet now merge into one pending map per view (
PendingSynchronousProps): a newer value wins, and a newernullstill resets the prop. Each pending update queues a mount item behind the pending mount items, and only the newest one applies the merged props, so they also wait for mount items queued in between, such as the one that creates the view. An update applied directly while props are pending applies them merged with its own and clears them.synchronouslyUpdateViewOnUIThreadand the batched path (synchronouslyUpdateViewBatch) both go through it; the batched path still looks each view up once unless props are pending for it.Changelog:
[Android][Fixed] - Fix a stale queued animated props update overwriting a newer one when a view mounts and updates in the same frame
Reviewed By: zeyap
Differential Revision: D132802978