mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-11 13:24:55 +01:00
fix: check cancellation status before tearing down terminal session store and connection registry
Moves deleteBySetupSessionId and closeBySetupSessionId to fire only after the non-terminal status guard, so terminal resources are not torn down when a forced delete is rejected due to a failed custom-image session cancellation. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
7bd74c3784
commit
c5c08b0089
1 file changed
+5
-5
@@ -335,17 +335,17 @@ export function environmentRoutes(
|
||||
sessionId: overview.activeSession.id,
|
||||
reason: "environment_deleted",
|
||||
});
|
||||
environmentCustomImageTerminalSessionStore.deleteBySetupSessionId(overview.activeSession.id);
|
||||
environmentCustomImageTerminalConnectionRegistry.closeBySetupSessionId(
|
||||
overview.activeSession.id,
|
||||
"environment_deleted",
|
||||
);
|
||||
if (cancelled.status === "failed" || ACTIVE_CUSTOM_IMAGE_SETUP_STATUSES_FOR_DELETE.has(cancelled.status)) {
|
||||
throw conflict(
|
||||
"Environment delete could not cancel the active custom image setup session. Retry after the failed setup cleanup is resolved.",
|
||||
{ setupSessionId: cancelled.id },
|
||||
);
|
||||
}
|
||||
environmentCustomImageTerminalSessionStore.deleteBySetupSessionId(overview.activeSession.id);
|
||||
environmentCustomImageTerminalConnectionRegistry.closeBySetupSessionId(
|
||||
overview.activeSession.id,
|
||||
"environment_deleted",
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user