Skip to content

[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
backport-8854-to-core-1.38
Feb 14, 2026
Merged

[backport core/1.38] fix: clear draft on workflow close to prevent stale state on reopen#8868
pythongosssss merged 1 commit intocore/1.38from
backport-8854-to-core-1.38

Conversation

@comfy-pr-bot
Copy link
Member

@comfy-pr-bot comfy-pr-bot commented Feb 14, 2026

Backport of #8854 to core/1.38

Automatically created by backport workflow.

┆Issue is synchronized with this Notion page by Unito

…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)
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Feb 14, 2026
@comfy-pr-bot comfy-pr-bot requested a review from a team as a code owner February 14, 2026 10:50
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 14, 2026
@github-actions
Copy link

github-actions bot commented Feb 14, 2026

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 02/14/2026, 10:51:54 AM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Feb 14, 2026

🎭 Playwright Tests: ⚠️ Passed with flaky tests

Results: 505 passed, 0 failed, 1 flaky, 8 skipped (Total: 514)

❌ Failed Tests

📊 Browser Reports
  • chromium: View Report (✅ 493 / ❌ 0 / ⚠️ 1 / ⏭️ 8)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 9 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

@pythongosssss pythongosssss merged commit 73e5157 into core/1.38 Feb 14, 2026
33 checks passed
@pythongosssss pythongosssss deleted the backport-8854-to-core-1.38 branch February 14, 2026 10:58
@comfy-pr-bot comfy-pr-bot added the released:core PR has been released to core label Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Backporting a PR onto a release candidate released:core PR has been released to core size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants