Skip to content

Commit 61a6b18

Browse files
waleedlatif1claude
andcommitted
fix(execution): reset execution state in reconnection cleanup to unblock re-entry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0c7a0bd commit 61a6b18

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,6 +2219,13 @@ export function useWorkflowExecution() {
22192219

22202220
return () => {
22212221
executionStream.cancel(reconnectWorkflowId)
2222+
// Reset execution state so the SPA guard doesn't block the next reconnection
2223+
// attempt when the user navigates back to this workflow.
2224+
// The cancel above causes an AbortError which is swallowed by
2225+
// isClientDisconnectError, so the .catch() block never fires.
2226+
setCurrentExecutionId(reconnectWorkflowId, null)
2227+
setIsExecuting(reconnectWorkflowId, false)
2228+
setActiveBlocks(reconnectWorkflowId, new Set())
22222229
}
22232230
// eslint-disable-next-line react-hooks/exhaustive-deps
22242231
}, [activeWorkflowId, hasHydrated])

0 commit comments

Comments
 (0)