From b99b4e825bbe33e0d38fa8580873e03cdd5e897e Mon Sep 17 00:00:00 2001 From: Glary-Bot Date: Fri, 22 May 2026 00:04:51 +0000 Subject: [PATCH] fix: wire XOR validation to production + check abort signal after auth await MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Apply zComboInputOptionsValidated (which enforces remote XOR remote_combo) inside zComboInputSpec/V2 so the refinement actually runs during validateComfyNodeDef parsing. Previously zComboInputOptions (without refinement) was used and the XOR check only fired in standalone unit tests. - After awaiting authStore.getAuthHeader() in executeRemoteRequest, check signal.aborted and throw AbortError if the request was canceled during the await — keeps abort semantics correct when a component unmounts mid-fetch. --- src/platform/remote/composables/useRemoteOptions.ts | 3 +++ src/schemas/nodeDefSchema.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/platform/remote/composables/useRemoteOptions.ts b/src/platform/remote/composables/useRemoteOptions.ts index 3c70b6e706..c274a056bc 100644 --- a/src/platform/remote/composables/useRemoteOptions.ts +++ b/src/platform/remote/composables/useRemoteOptions.ts @@ -35,6 +35,9 @@ async function executeRemoteRequest( if (descriptor.client === 'comfyApi') { const authStore = useAuthStore() const authHeader = await authStore.getAuthHeader() + if (signal.aborted) { + throw new DOMException('Aborted', 'AbortError') + } headers = authHeader ? { ...authHeader } : undefined } const url = resolveUrl(descriptor, getComfyApiBaseUrl()) diff --git a/src/schemas/nodeDefSchema.ts b/src/schemas/nodeDefSchema.ts index 4cfe89148a..7ed28293b6 100644 --- a/src/schemas/nodeDefSchema.ts +++ b/src/schemas/nodeDefSchema.ts @@ -160,11 +160,11 @@ const zStringInputSpec = z.tuple([ */ const zComboInputSpec = z.tuple([ z.array(zComboOption), - zComboInputOptions.optional() + zComboInputOptionsValidated.optional() ]) const zComboInputSpecV2 = z.tuple([ z.literal('COMBO'), - zComboInputOptions.optional() + zComboInputOptionsValidated.optional() ]) export function isComboInputSpecV1(