Repository navigation
fix(chat): bring a restored workflow's chat back online when it is relaunched - #9888
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
1 issue found across 4 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/lib/chat-deployments/application/update-chat-deployment.ts">
<violation number="1" location="apps/sim/lib/chat-deployments/application/update-chat-deployment.ts:209">
P1: This re-enables the chat after accepting an `active` attempt without confirming that the attempt is current or that an active deployment version exists. Mirror the shared deploy path's `isCurrent` and `activeDeployment` checks before writing `isActive: true`, otherwise the UI can report a launched chat that still cannot answer.</violation>
</file>
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryRestored chats come back online when explicitly relaunched.
|
e4fe915 to
425aad5
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
…yment, matching the shared deploy path
425aad5 to
0e22b66
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
isActive: false; restore clears onlyarchivedAt, so the restored chat kept answering 403 "This chat is currently unavailable"isActive, so the chat stayed offline and the modal kept offering "Launch Chat" with Delete hidden — no way out from the UIisActive: truein both paths:updateChatDeployment(editor PATCH, v2 PATCH) andperformChatDeploy's update branch (internal POST, v2 deploy, Copilotdeploy_chat). Both already guarantee an active workflow deployment before writing the row, so the chat is only marked live when it can answerlib/folders/config.tsupdated)Side effects checked
chat.isActive = false(workflow archive, fork promote, fork rollback) setsarchivedAtin the same statement, and no API acceptsisActiveas input. The only rows this can change are chats restored after an archivearchivedAt IS NULL, so a chat whose workflow is still deleted cannot be reactivated (covered by a test)Type of Change
Testing
lib/chat-deployments/__integration__/relaunch-after-restore.integration.tsagainst real Postgres: real deploy → archive → restore → relaunch throughupdateChatDeploymentand throughperformChatDeploy, plus a deleted-workflow negative casecheck:auditsand the suite run in CIChecklist
test-auditauthoring gate)