fix: skip loading drafts when Comfy.Workflow.Persist is disabled#8851
fix: skip loading drafts when Comfy.Workflow.Persist is disabled#8851
Conversation
When Persist was turned off, ComfyWorkflow.load() still unconditionally read drafts from localStorage, causing unsaved changes to reappear. - Guard draft loading in ComfyWorkflow.load() with Persist setting check - Clear all drafts from localStorage when Persist is switched to false - Add test for draft cleanup on Persist toggle Fixes Comfy-Org/ComfyUI#12323 Amp-Thread-ID: https://ampcode.com/threads/T-019c577a-e372-700f-9bb6-bd556a4b149c Co-authored-by: Amp <amp@ampcode.com>
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 02/13/2026, 05:27:36 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
|
Playwright: ✅ 524 passed, 0 failed · 1 flaky 📊 Browser Reports
|
📝 WalkthroughWalkthroughA runtime feature flag ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 21.7 kB (baseline 21.7 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 879 kB (baseline 879 kB) • 🔴 +144 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 68.9 kB (baseline 68.9 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 11 added / 11 removed Panels & Settings — 427 kB (baseline 427 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 22 added / 22 removed User & Accounts — 16.1 kB (baseline 16.1 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 7 added / 7 removed Editors & Dialogs — 785 B (baseline 785 B) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 1 added / 1 removed UI Components — 36.6 kB (baseline 36.6 kB) • ⚪ 0 BReusable component library chunks
Status: 10 added / 10 removed Data & Services — 2.16 MB (baseline 2.15 MB) • 🔴 +1.24 kBStores, services, APIs, and repositories
Status: 15 added / 14 removed Utilities & Hooks — 237 kB (baseline 237 kB) • 🔴 +1 BHelpers, composables, and utility bundles
Status: 17 added / 17 removed Vendor & Third-Party — 8.69 MB (baseline 8.69 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Status: 5 added / 5 removed Other — 7.31 MB (baseline 7.31 MB) • ⚪ 0 BBundles that do not match a named category
Status: 121 added / 121 removed |
Port two bug fixes to V2 persistence system: From #8854 (clear draft on workflow close): - workflowStore.ts: removeDraft() now runs for ALL workflows, not just temporary - workflowService.ts: remove draft BEFORE tab switch to prevent re-saving From #8851 (skip drafts when Persist disabled): - comfyWorkflow.ts: guard draft loading with Persist setting check - useWorkflowPersistenceV2.ts: watch to clear drafts when Persist toggled off Amp-Thread-ID: https://ampcode.com/threads/T-019c5898-2097-7710-aab9-52c38a97399a
Port two bug fixes to V2 persistence system: From #8854 (clear draft on workflow close): - workflowStore.ts: removeDraft() now runs for ALL workflows, not just temporary - workflowService.ts: remove draft BEFORE tab switch to prevent re-saving From #8851 (skip drafts when Persist disabled): - comfyWorkflow.ts: guard draft loading with Persist setting check - useWorkflowPersistenceV2.ts: watch to clear drafts when Persist toggled off Amp-Thread-ID: https://ampcode.com/threads/T-019c5898-2097-7710-aab9-52c38a97399a
Port two bug fixes to V2 persistence system: From #8854 (clear draft on workflow close): - workflowStore.ts: removeDraft() now runs for ALL workflows, not just temporary - workflowService.ts: remove draft BEFORE tab switch to prevent re-saving From #8851 (skip drafts when Persist disabled): - comfyWorkflow.ts: guard draft loading with Persist setting check - useWorkflowPersistenceV2.ts: watch to clear drafts when Persist toggled off Amp-Thread-ID: https://ampcode.com/threads/T-019c5898-2097-7710-aab9-52c38a97399a
Port two bug fixes to V2 persistence system: From #8854 (clear draft on workflow close): - workflowStore.ts: removeDraft() now runs for ALL workflows, not just temporary - workflowService.ts: remove draft BEFORE tab switch to prevent re-saving From #8851 (skip drafts when Persist disabled): - comfyWorkflow.ts: guard draft loading with Persist setting check - useWorkflowPersistenceV2.ts: watch to clear drafts when Persist toggled off Amp-Thread-ID: https://ampcode.com/threads/T-019c5898-2097-7710-aab9-52c38a97399a
Port two bug fixes to V2 persistence system: From #8854 (clear draft on workflow close): - workflowStore.ts: removeDraft() now runs for ALL workflows, not just temporary - workflowService.ts: remove draft BEFORE tab switch to prevent re-saving From #8851 (skip drafts when Persist disabled): - comfyWorkflow.ts: guard draft loading with Persist setting check - useWorkflowPersistenceV2.ts: watch to clear drafts when Persist toggled off Amp-Thread-ID: https://ampcode.com/threads/T-019c5898-2097-7710-aab9-52c38a97399a
Port two bug fixes to V2 persistence system: From #8854 (clear draft on workflow close): - workflowStore.ts: removeDraft() now runs for ALL workflows, not just temporary - workflowService.ts: remove draft BEFORE tab switch to prevent re-saving From #8851 (skip drafts when Persist disabled): - comfyWorkflow.ts: guard draft loading with Persist setting check - useWorkflowPersistenceV2.ts: watch to clear drafts when Persist toggled off Amp-Thread-ID: https://ampcode.com/threads/T-019c5898-2097-7710-aab9-52c38a97399a
Port two bug fixes to V2 persistence system: From #8854 (clear draft on workflow close): - workflowStore.ts: removeDraft() now runs for ALL workflows, not just temporary - workflowService.ts: remove draft BEFORE tab switch to prevent re-saving From #8851 (skip drafts when Persist disabled): - comfyWorkflow.ts: guard draft loading with Persist setting check - useWorkflowPersistenceV2.ts: watch to clear drafts when Persist toggled off Amp-Thread-ID: https://ampcode.com/threads/T-019c5898-2097-7710-aab9-52c38a97399a
Port two bug fixes to V2 persistence system: From #8854 (clear draft on workflow close): - workflowStore.ts: removeDraft() now runs for ALL workflows, not just temporary - workflowService.ts: remove draft BEFORE tab switch to prevent re-saving From #8851 (skip drafts when Persist disabled): - comfyWorkflow.ts: guard draft loading with Persist setting check - useWorkflowPersistenceV2.ts: watch to clear drafts when Persist toggled off Amp-Thread-ID: https://ampcode.com/threads/T-019c5898-2097-7710-aab9-52c38a97399a
Port two bug fixes to V2 persistence system: From #8854 (clear draft on workflow close): - workflowStore.ts: removeDraft() now runs for ALL workflows, not just temporary - workflowService.ts: remove draft BEFORE tab switch to prevent re-saving From #8851 (skip drafts when Persist disabled): - comfyWorkflow.ts: guard draft loading with Persist setting check - useWorkflowPersistenceV2.ts: watch to clear drafts when Persist toggled off Amp-Thread-ID: https://ampcode.com/threads/T-019c5898-2097-7710-aab9-52c38a97399a
Port two bug fixes to V2 persistence system: From #8854 (clear draft on workflow close): - workflowStore.ts: removeDraft() now runs for ALL workflows, not just temporary - workflowService.ts: remove draft BEFORE tab switch to prevent re-saving From #8851 (skip drafts when Persist disabled): - comfyWorkflow.ts: guard draft loading with Persist setting check - useWorkflowPersistenceV2.ts: watch to clear drafts when Persist toggled off Amp-Thread-ID: https://ampcode.com/threads/T-019c5898-2097-7710-aab9-52c38a97399a
Summary
Skip draft loading and clear stored drafts when
Comfy.Workflow.Persistis disabled, preventing unsaved changes from reappearing.Changes
ComfyWorkflow.load()withComfy.Workflow.Persistsetting check. Clear all localStorage drafts when Persist is toggled from true to false.Review Focus
ComfyWorkflow.load()previously read drafts unconditionally regardless of the Persist setting. This meant that after disabling Persist, previously stored drafts would still be applied when opening a saved workflow. The fix adds a guard in two places:comfyWorkflow.ts:load()now checksComfy.Workflow.Persistbefore callinggetDraft()useWorkflowPersistence.ts: Awatchon the Persist setting callsdraftStore.reset()when disabledFixes Comfy-Org/ComfyUI#12323
┆Issue is synchronized with this Notion page by Unito