Skip to content

Commit

Permalink
fix(dal): Send WsEvents to delete connections when upgrading a component
Browse files Browse the repository at this point in the history
As we have an old component being deleted, we need to send WsEvents to delete the old connections
  • Loading branch information
stack72 committed Jul 23, 2024
1 parent 68ab17a commit 65e3c59
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/dal/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3669,6 +3669,17 @@ impl Component {
incoming.to_input_socket_id,
)
.await?;

WsEvent::connection_deleted(
ctx,
incoming.from_component_id,
incoming.to_component_id,
incoming.from_output_socket_id,
incoming.to_input_socket_id,
)
.await?
.publish_on_commit(ctx)
.await?;
}

for outgoing in &original_outgoing_connections {
Expand All @@ -3680,6 +3691,17 @@ impl Component {
outgoing.to_input_socket_id,
)
.await?;

WsEvent::connection_deleted(
ctx,
outgoing.from_component_id,
outgoing.to_component_id,
outgoing.from_output_socket_id,
outgoing.to_input_socket_id,
)
.await?
.publish_on_commit(ctx)
.await?;
}

// Let's requeue any Actions for the component
Expand Down

0 comments on commit 65e3c59

Please sign in to comment.