From 65e3c590bbb7d34dc1844983be4db07e6136182b Mon Sep 17 00:00:00 2001 From: stack72 Date: Tue, 23 Jul 2024 17:44:29 +0100 Subject: [PATCH] fix(dal): Send WsEvents to delete connections when upgrading a component As we have an old component being deleted, we need to send WsEvents to delete the old connections --- lib/dal/src/component.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/dal/src/component.rs b/lib/dal/src/component.rs index 5f70b09e13..a22ec4e409 100644 --- a/lib/dal/src/component.rs +++ b/lib/dal/src/component.rs @@ -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 { @@ -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