From 2bce046278ba9852c0e5fcd02ad59c577681cd3c Mon Sep 17 00:00:00 2001 From: hjlarry Date: Sat, 11 Oct 2025 14:17:58 +0800 Subject: [PATCH] fix node error default value not sync --- .../nodes/_base/components/error-handle/hooks.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/nodes/_base/components/error-handle/hooks.ts b/web/app/components/workflow/nodes/_base/components/error-handle/hooks.ts index 06eb4fc48f..01f13e6293 100644 --- a/web/app/components/workflow/nodes/_base/components/error-handle/hooks.ts +++ b/web/app/components/workflow/nodes/_base/components/error-handle/hooks.ts @@ -30,8 +30,15 @@ export const useDefaultValue = ( const index = default_value.findIndex(form => form.key === key) if (index > -1) { - const newDefaultValue = [...default_value] - newDefaultValue[index].value = value + const newDefaultValue = default_value.map((form) => { + if (form.key !== key) + return form + // clone the entry so we do not mutate the original reference (which would block CRDT diffs) + return { + ...form, + value, + } + }) handleNodeDataUpdateWithSyncDraft({ id, data: {