-
Notifications
You must be signed in to change notification settings - Fork 673
fix(errors): keep missing node packs across prompt submissions #14900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,6 +113,7 @@ import { normalizePromptError } from '@/utils/executionErrorUtil' | |
| import { graphToPrompt } from '@/utils/executionUtil' | ||
| import { parseJsonWithNonFinite } from '@/utils/jsonUtil' | ||
| import { getCnrIdFromProperties } from '@/platform/nodeReplacement/cnrIdUtil' | ||
| import { useMissingNodesErrorStore } from '@/platform/nodeReplacement/missingNodesErrorStore' | ||
| import { rescanAndSurfaceMissingNodes } from '@/platform/nodeReplacement/missingNodeScan' | ||
| import { | ||
| refreshMissingModelPipeline, | ||
|
|
@@ -1645,7 +1646,7 @@ export class ComfyApp { | |
| const executionStore = useExecutionStore() | ||
| const executionErrorStore = useExecutionErrorStore() | ||
| const telemetry = useTelemetry() | ||
| executionErrorStore.clearAllErrors() | ||
| executionErrorStore.clearRunErrors() | ||
| let queueResultOverride: boolean | null = null | ||
|
|
||
| // Get auth token for backend nodes - uses workspace token if enabled, otherwise Firebase token | ||
|
|
@@ -2019,7 +2020,11 @@ export class ComfyApp { | |
| // Use parameters strictly as the final fallback | ||
| if (parameters && typeof parameters === 'string') { | ||
| const outcome = await importA1111(this.rootGraph, parameters, () => { | ||
| useWorkflowService().beforeLoadNewGraph() | ||
| try { | ||
| useWorkflowService().beforeLoadNewGraph() | ||
| } finally { | ||
| useMissingNodesErrorStore().setMissingNodeTypes([]) | ||
| } | ||
| this.canvas.setGraph(this.rootGraph) | ||
| }) | ||
| if (outcome === 'core-nodes-unavailable') { | ||
|
|
@@ -2430,7 +2435,8 @@ export class ComfyApp { | |
| const nodeOutputStore = useNodeOutputStore() | ||
| nodeOutputStore.resetAllOutputsAndPreviews() | ||
| const executionErrorStore = useExecutionErrorStore() | ||
| executionErrorStore.clearAllErrors() | ||
| executionErrorStore.clearRunErrors() | ||
| useMissingNodesErrorStore().setMissingNodeTypes([]) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: (non-blocking)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed on the direction, deferring it — and I want to be explicit about why rather than just declining. An earlier version of this PR did exactly this: a shared reset covering all three stores, called from The root of it is that missing nodes are a synchronous derived fact — one ref, no async, no controller — while models and media are the result of network verification that outlives the graph that started it, with a per-workflow cache and a two-tier repair state. A So the same seam you are pointing at is the right one, but it wants a graph generation token and cache ownership to go with it, not just a combined call. That is written up and will be its own change. This PR stays at two production lines plus the A1111 compensation. |
||
|
|
||
| useDomWidgetStore().clear() | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,15 +118,13 @@ export const useExecutionErrorStore = defineStore('executionError', () => { | |
| isErrorOverlayOpen.value = false | ||
| } | ||
|
|
||
| /** Clear all error state. | ||
| * Missing model state is intentionally preserved here to avoid wiping | ||
| * in-progress model repairs (importTaskIds, URL inputs, etc.). | ||
| * Missing models are cleared separately during workflow load/clean paths. */ | ||
| function clearAllErrors() { | ||
| /** Clear error state produced by a run. Missing-resource state describes the | ||
| * loaded graph rather than the run, so only replacing or discarding the | ||
| * graph invalidates it. */ | ||
| function clearRunErrors() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: (non-blocking)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checked the description and there is nothing to correct — it does not mention The delegation you are describing is also not in this diff. Flagging it in case it came from an earlier revision of this branch — there was one, and it did touch more of this file. |
||
| lastExecutionError.value = null | ||
| lastPromptError.value = null | ||
| lastNodeErrors.value = null | ||
| missingNodesStore.setMissingNodeTypes([]) | ||
| isErrorOverlayOpen.value = false | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
|
|
@@ -585,7 +583,7 @@ export const useExecutionErrorStore = defineStore('executionError', () => { | |
| recordPromptError, | ||
|
|
||
| // Clearing | ||
| clearAllErrors, | ||
| clearRunErrors, | ||
| clearExecutionStartErrors, | ||
| clearPromptError, | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: (non-blocking) The A1111 tests cover the success path (callback fires,
setMissingNodeTypes([])runs) and several failure modes. One gap: no test asserts that missing-node state is NOT cleared whenimportA1111returns'not-a1111'or'core-nodes-unavailable'(without callingbeforeGraphClear). The PR description says "a failed import keeps the current state" -- that is correct by inspection, but consider adding a test case:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, for both outcomes:
Worth doing because the PR description asserted it and nothing pinned it. Mutation check: hoisting the clear out of the callback so it runs unconditionally fails both cases.