[backport core/1.38] fix: clear draft on workflow close to prevent stale state on reopen#8868
Merged
pythongosssss merged 1 commit intocore/1.38from Feb 14, 2026
Merged
Conversation
…8854) ## Summary Clear the workflow draft from localStorage when any workflow tab is closed, preventing stale cached state from being served when the workflow is re-opened. ## Changes - **What**: `closeWorkflow()` in `workflowStore.ts` now calls `removeDraft()` for all workflows, not just temporary ones. `closeWorkflow()` in `workflowService.ts` removes the draft before switching tabs, preventing `beforeLoadNewGraph()` from re-saving it. ## Review Focus - Draft is removed before the tab switch in `workflowService.closeWorkflow()` to prevent `beforeLoadNewGraph()` from re-saving it during the switch - Crash recovery is preserved: drafts are only cleared on explicit close, not on unload/crash - Tab restore on restart is unaffected: drafts for intentionally-open tabs are saved on graph change events, not on close Fixes #8778 Fixes Comfy-Org/ComfyUI#12323 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8854-fix-clear-draft-on-workflow-close-to-prevent-stale-state-on-reopen-3066d73d365081a2a633c9b352d0b0d1) by [Unito](https://www.unito.io)
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 02/14/2026, 10:51:54 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Tests:
|
pythongosssss
approved these changes
Feb 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #8854 to
core/1.38Automatically created by backport workflow.
┆Issue is synchronized with this Notion page by Unito