Skip to content

fix(ui): prevent duplicate chatflow saves#6503

Open
luochen211 wants to merge 1 commit into
FlowiseAI:mainfrom
luochen211:fix-save-chatflow-double-submit
Open

fix(ui): prevent duplicate chatflow saves#6503
luochen211 wants to merge 1 commit into
FlowiseAI:mainfrom
luochen211:fix-save-chatflow-double-submit

Conversation

@luochen211

Copy link
Copy Markdown

Summary

  • guard chatflow and Agentflow V2 save handlers while a save request is pending
  • disable the canvas save control during create/update requests
  • disable the new-chatflow save dialog submit while the request is in flight

Fixes #6502

Tests

  • corepack pnpm@10.26.0 exec eslint packages/ui/src/views/canvas/index.jsx packages/ui/src/views/agentflowsv2/Canvas.jsx packages/ui/src/views/canvas/CanvasHeader.jsx packages/ui/src/ui-component/dialog/SaveChatflowDialog.jsx
  • corepack pnpm@10.26.0 exec prettier --check packages/ui/src/views/canvas/index.jsx packages/ui/src/views/agentflowsv2/Canvas.jsx packages/ui/src/views/canvas/CanvasHeader.jsx packages/ui/src/ui-component/dialog/SaveChatflowDialog.jsx
  • corepack pnpm@10.26.0 --filter flowise-ui run build
  • git diff --check

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces mechanisms to prevent duplicate or concurrent saving of chatflows in both the standard Canvas and AgentflowCanvas. It tracks in-flight save requests using a reference (saveInProgressRef) and disables save triggers and buttons across the UI, updating the save button text to "Saving..." during submission. Feedback on these changes suggests also disabling the "Cancel" button in the SaveChatflowDialog while a save is in progress to prevent users from closing the dialog mid-transaction.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

/>
</DialogContent>
<DialogActions>
<Button onClick={onCancel}>{dialogProps.cancelButtonName}</Button>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While saving is in progress (isSubmitting is true), the Cancel button should also be disabled to prevent the user from closing the dialog or triggering other actions while the transaction is in flight.

Suggested change
<Button onClick={onCancel}>{dialogProps.cancelButtonName}</Button>
<Button disabled={isSubmitting} onClick={onCancel}>{dialogProps.cancelButtonName}</Button>

@luochen211 luochen211 force-pushed the fix-save-chatflow-double-submit branch from 9c3c289 to 8e67a89 Compare June 11, 2026 10:15
@luochen211

Copy link
Copy Markdown
Author

Addressed the review suggestion by disabling Cancel, Escape, and dialog close while the save request is in progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple Chatflows Created When Save/Create Button Is Clicked Repeatedly

1 participant