Skip to content

Commit

Permalink
Fix seenGroupNodeIds mismatch with modelGraph nodes data.
Browse files Browse the repository at this point in the history
looks like the `seenGroupNodeIds` data set may contain group node id that does not belong to the current `modelGraph` nodes data, causing the lookup for node from modelGraph returns undefined (NodeA/NodeB), thus the group layer comparison fails.

PiperOrigin-RevId: 696656783
  • Loading branch information
zzzaries authored and copybara-github committed Nov 14, 2024
1 parent 8efb555 commit 04a50af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ui/src/components/visualizer/worker/graph_expander.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ export class GraphExpander {
const queue: string[] = [...groupNodeIds];
while (queue.length > 0) {
const curGroupNodeId = queue.shift()!;
if (seenGroupNodeIds.has(curGroupNodeId)) {
if (
seenGroupNodeIds.has(curGroupNodeId) ||
!this.modelGraph.nodesById[curGroupNodeId]
) {
continue;
}
seenGroupNodeIds.add(curGroupNodeId);
Expand Down

0 comments on commit 04a50af

Please sign in to comment.