Skip to content

bug: diff view tree omits changed nodes whose parent node is unchanged #10010

Description

@lancamat1

Component

Frontend UI

Infrahub version

1.10.0 (regression present since #5676, Feb 2025)

Current Behavior

On the branch/proposed-change diff Data view, the left-hand tree omits changed nodes when their hierarchical parent has no changes of its own. The right-hand diff list shows them correctly, so the two panes disagree.

The DiffTree GraphQL response (queried with include_parents: true) intentionally contains the parent nodes with status: UNCHANGED as hierarchy context (added by parent_node_adder.py). The frontend filters out all UNCHANGED nodes in entities/diff/ui/node-diff/index.tsx before building the tree, and buildDiffTreeItems (entities/diff/utils/build-diff-tree-items.ts) then silently drops any node whose parent.uuid cannot be found among the tree items.

The drop is transitive: a changed parent that was itself dropped takes its changed children with it (e.g. an ADDED prefix under an UPDATED prefix under an unchanged root prefix disappears too).

Expected Behavior

Every changed node visible in the right-hand diff list also appears in the left tree, nested under its (unchanged) parent — as it did before the regression, where unchanged parents were rendered as context items in the tree.

Steps to Reproduce

Reproducible on https://sandbox.infrahub.app (1.10.0), demo login, no data changes needed:

  1. Open Branches › jfk1-update-edge-ips › Data.
  2. The right pane shows i.a. two Updated Infra › Interface L3 Ethernet1 (parents jfk1-edge1/jfk1-edge2 are unchanged), Updated Ipam › IP Prefix 10.1.0.0/16, and Added Ipam › IP Prefix 10.1.0.32/31.
  3. The left tree contains only IP Address → 10.1.0.33/31, 10.1.0.32/31 and IPAM Namespace → default. Both interfaces and both prefixes are missing (verified via the tree DOM — not a collapsed-node issue).

Originally reported by a customer (Slack, #ext-rolex, 2026-07-22): an updated Loadbalancer Pool Member shown in the right pane had no entry in the left tree because its pool was unchanged.

Additional Information

  • Regression origin: commit 1c4a0f9ce (Incrementally load node diff in UI view #5676, "Incrementally load node diff in UI view") moved the UNCHANGED filter from the right-pane render into the shared nodes computation feeding both panes. Before that (Update diff tree construction by using "parent" value of DiffTree query #4199), the tree received all nodes and only the right pane filtered UNCHANGED.
  • Drop site: frontend/app/src/entities/diff/utils/build-diff-tree-items.tsif (!parentTreeItem) return acc;. This is also order-sensitive for multi-level parent chains.
  • Screenshot of the sandbox reproduction available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    group/frontendIssue related to the frontend (React)type/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions