Skip to content

Commit c282858

Browse files
committed
fix(workflows): address PR review — await description update, revert state PUT throw
- api-info-modal: use mutateAsync for description update so errors are caught by the surrounding try/catch instead of silently swallowed - useCreateWorkflow: revert state PUT to log-only — the workflow is already created in the DB, throwing rolls back the optimistic entry and makes it appear the creation failed when it actually succeeded
1 parent a9fa508 commit c282858

File tree

2 files changed

+2
-2
lines changed
  • apps/sim
    • app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/components
    • hooks/queries

2 files changed

+2
-2
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/components/api-info-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export function ApiInfoModal({ open, onOpenChange, workflowId }: ApiInfoModalPro
177177
}
178178

179179
if (description.trim() !== (workflowMetadata?.description || '')) {
180-
updateWorkflowMutation.mutate({
180+
await updateWorkflowMutation.mutateAsync({
181181
workspaceId,
182182
workflowId,
183183
metadata: { description: description.trim() || 'New workflow' },

apps/sim/hooks/queries/workflows.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export function useCreateWorkflow() {
207207

208208
if (!stateResponse.ok) {
209209
const text = await stateResponse.text()
210-
throw new Error(`Failed to persist default workflow state: ${text}`)
210+
logger.error('Failed to persist default workflow state:', text)
211211
}
212212

213213
return {

0 commit comments

Comments
 (0)