Skip to content

Conversation

@eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Nov 10, 2025

Stacked on #35107

We used to flush operations between unmounting each root and remounting each root. This could lead to focus or selection loss when the focused/selected element was temporarily removed while we were mounting the root again in the backend. Notably when keyboard navigating through the Activity list and focusing on a specific Activity. We'd flush after each root was unmounted leading to an unnmount of the Activity list since no more named Activities existed.

Looks like a leftover from when flushing operations was tied to a root. If this leads to crashes due to operations sent being too large, we should implement some streaming approach where the frontend can decide if it wants to flush between each chunk (operations for one root) or at the end.

Alternatively we could also flush after processing each root when processing unmount+mount i.e.

unmount(1)
mount(1)
flush()

unmount(2)
mount(2)
flush()

instead of

unmount(1)
flush()
unmount(2)
flush()

mount(1)
flush()
mount(2)
flush()

@meta-cla meta-cla bot added the CLA Signed label Nov 10, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Nov 10, 2025
@eps1lon eps1lon requested review from hoxyq and sebmarkbage November 10, 2025 08:32
@eps1lon eps1lon marked this pull request as ready for review November 10, 2025 08:32
@eps1lon eps1lon force-pushed the sebbie/11-10-_devtools_batch_updates_when_updating_component_filters branch from ab42bbc to d9ae1a6 Compare November 11, 2025 10:15
@eps1lon eps1lon force-pushed the sebbie/11-10-_devtools_batch_updates_when_updating_component_filters branch from d9ae1a6 to 871e4c1 Compare November 11, 2025 22:12
@eps1lon eps1lon merged commit 1ea46df into main Nov 11, 2025
238 checks passed
@eps1lon eps1lon deleted the sebbie/11-10-_devtools_batch_updates_when_updating_component_filters branch November 11, 2025 22:26
manNomi pushed a commit to manNomi/react that referenced this pull request Nov 15, 2025
github-actions bot pushed a commit to code/lib-react that referenced this pull request Nov 15, 2025
github-actions bot pushed a commit to code/lib-react that referenced this pull request Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants