Skip to content

Commit

Permalink
Merge pull request #5176 from systeminit/brit/bug-726-action-dependen…
Browse files Browse the repository at this point in the history
…cies-are-inconsistently-inaccurate

fix(dal): The order in which we process dependencies between components is inconsistent, so we must always check if the component is in the dependency graph before adding it as Petgraph doesn't prevent nodes with duplicate node weights from being inserted
  • Loading branch information
fnichol authored Dec 20, 2024
2 parents e643595 + aebbf29 commit f9abf07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/dal/src/action/dependency_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ impl ActionDependencyGraph {
// things they are feeding data into.
for component_id in actions_by_component_id.keys().copied() {
let component = Component::get_by_id(ctx, component_id).await?;
let component_index = component_dependencies.add_node(component_id);
component_dependencies_index_by_id.insert(component_id, component_index);
let component_index = component_dependencies_index_by_id
.entry(component_id)
.or_insert_with(|| component_dependencies.add_node(component_id))
.to_owned();
for incoming_connection in component.incoming_connections(ctx).await? {
component_dependencies_index_by_id
.entry(incoming_connection.from_component_id)
Expand Down

0 comments on commit f9abf07

Please sign in to comment.