You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(deploy): stop the redeploy check checking out a second connection
`checkNeedsRedeployment` opens a REPEATABLE READ transaction and then called
`materializeDeploymentState` without a workspaceId, which resolves one through
`getActiveWorkflowContext` — on the global pool. A transaction holding one
connection while awaiting a second checkout starves the pool under any
concurrency, and this endpoint is polled and refetches on window focus. The
nested read then failed and surfaced as a 500 on `/api/workflows/[id]/deploy`,
with the failing statement being the authz context lookup rather than anything
the caller wrote. Introduced by the operand fix earlier on this branch.
`materializeDeploymentState` now REQUIRES a workspaceId, so it cannot check out
a connection at all and is safe inside any transaction by construction; the two
non-transactional entry points resolve theirs through a named helper that says
so. The type change surfaced both remaining callers rather than leaving the
hazard to be avoided by convention.
The UI half: an absent answer was rendered as a positive one, three times over.
`isDeployed` is `deploymentInfo?.isDeployed ?? false`, so a pending OR FAILED
request was indistinguishable from a genuinely undeployed workflow — the modal
told the user to deploy a workflow whose version list showed v4 live. The status
now reports `unknown` until deployment info actually answers, the chip is
disabled there (a click is interpreted against that same flag: deployed opens
the modal, undeployed deploys), and the General tab renders a skeleton rather
than claiming undeployed whenever the live workflow cannot yet be shown.
No retry or fallback: the earlier draft of this commit polled the snapshot query
while it held no data, which papered over the pool starvation instead of fixing
it. That is removed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-deploy-button-status.test.ts
+55-5Lines changed: 55 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ type Input = Parameters<typeof resolveDeployButtonStatus>[0]
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-deploy-button-status.ts
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-deployment-view-state.ts
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,8 @@ export function useDeploymentViewState({
0 commit comments