Skip to content

[HIGH] get_scene_dependencies descends into SerializedProperty children on every iteration #71

Description

@Daliys

Problem

get_scene_dependencies uses the wrong SerializedProperty iterator pattern and keeps enterChildren true for every loop iteration.

Evidence

  • Editor/MCPServerMethods.Snapshot.cs:204-209 initializes enterChildren = true, then sets it back to true inside the loop.
  • Nearby code in Editor/MCPServerMethods.Snapshot.cs:130-136 sets enterChildren = false after the first iteration.
  • Editor/MCPServerMethods.Search.cs:204-210 uses the same correct flat-walk pattern for reference search.

Impact

The dependency walker can descend into nested compound properties repeatedly, producing dependency output that is inconsistent with sibling tools and likely noisier or duplicated for array/list/nested-struct-heavy components.

Suggested fix

Set enterChildren = false after the first Next(enterChildren) call, matching the other SerializedProperty walks.

Source report

Imported from audit report item: correctness (11) / Editor/MCPServerMethods.Snapshot.cs:208.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageImported or reported issue awaiting owner reviewpriority: highMajor broken workflow or broad compatibility failuresurface: serializationSerializedProperty, object references, and serialization workflowssurface: unity-editorUnity Editor package, windows, menus, or C# server surfacetype: correctnessIncorrect result, bad validation, or misleading success/failure behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions