fix(devtools): duplicated props in the properties panel#66712
Merged
AndrewKushnir merged 1 commit intoangular:mainfrom Feb 9, 2026
Merged
fix(devtools): duplicated props in the properties panel#66712AndrewKushnir merged 1 commit intoangular:mainfrom
AndrewKushnir merged 1 commit intoangular:mainfrom
Conversation
Fix the diff algorithm that consequentially caused the duplicated props.
AleksanderBodurri
approved these changes
Feb 9, 2026
Contributor
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This fixes the issue mentioned in this PR comment.
Bug & Steps To Reproduce
In essence, sometimes* the children of a property in the Properties panel are duplicated. Often, this happens for a brief moment, making the issue a bit hard to catch and diagnose. Here are some steps to reproduce (one example) in the demo app without having to modify the existing code:
app-sample-properties.computedObject– in the Properties panel. This should happen beforeapp-heavyis loaded.app-heavyis loaded, the nested properties will be duplicated.Obviously, there are minimal reproducible examples, but they require significant modifications to the app.
Culprit
After an extensive investigation, it appears that the culprit is the
difffunction which is in charge of finding the difference between and modifying the existingFlatNodetree by a provided new one in the property data source. Here is the exact mechanism of the bug:FlatNodetree is fed to thedifffunction along with the existing tree without nested props.is
[x, x1, x2, y, y2]where each property contains the level of nesting, all nodes except the first one are affected by the update (e.g. new nodes and moved nodes), meaning that in the given example onlyxremains unchanged.5. However,
xtechnically keeps (should keep) a reference to its children that is used to determine whether its children are loaded.6. If the user expands
x, the program determines thatxdoesn't have its nested properties loaded based on the reference.7. This results in another nested props request that technically leads to the duplication of these props.
Fix
diffnow performs an additional identity check and updates the items that haven't been moved or changed in any other way but their reference (respectively, internals).Also, there are some unit tests to cover for the core
diffoperations.@AleksanderBodurri, I think it's best that you review the PR since the code probably dates back to the very first versions of the DevTools. It seems that the bug is quite old.
* While the culprit of the bug was found and it's evident that the affected nodes are the ones which internals were changed but retained their position in the array (usually, first nodes in the array), I haven't delved into why the properties resolve or stabilize by themselves, so to speak. I assume it has to do with component tree updates triggering some sort of a refresh.