fix: saveAndWait must also wait for isTemporary to become false

The share dialog's refreshDialogState() checks workflow.isTemporary —
if true, it shows 'unsaved' state. After saving a temporary workflow,
the backend response updates size (making isTemporary false), but the
test was only waiting for isModified === false, creating a race where
the dialog could open before the workflow was fully persisted.
This commit is contained in:
bymyself
2026-03-30 15:51:11 -07:00
parent 6c325275d8
commit 323e9bcfc0

View File

@@ -109,11 +109,13 @@ async function saveAndWait(
): Promise<void> {
await comfyPage.menu.topbar.saveWorkflow(workflowName)
await comfyPage.page.waitForFunction(
() =>
(window.app!.extensionManager as WorkspaceStore).workflow.activeWorkflow
?.isModified === false,
() => {
const wf = (window.app!.extensionManager as WorkspaceStore).workflow
.activeWorkflow
return wf !== null && !wf.isTemporary && !wf.isModified
},
undefined,
{ timeout: 3000 }
{ timeout: 5000 }
)
}