fix(ui): prevent duplicate chatflow saves#6503
Conversation
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
| <Button onClick={onCancel}>{dialogProps.cancelButtonName}</Button> | |
| <Button disabled={isSubmitting} onClick={onCancel}>{dialogProps.cancelButtonName}</Button> |
9c3c289 to
8e67a89
Compare
|
Addressed the review suggestion by disabling Cancel, Escape, and dialog close while the save request is in progress. |
Summary
Fixes #6502
Tests