Skip to content

fix: normalize spaces in workflow variable inputs - #2309

Open
Iams4kura wants to merge 1 commit into
dataelement:mainfrom
Iams4kura:bugfix/normalize-variable-spaces-20260817t031517z
Open

fix: normalize spaces in workflow variable inputs#2309
Iams4kura wants to merge 1 commit into
dataelement:mainfrom
Iams4kura:bugfix/normalize-variable-spaces-20260817t031517z

Conversation

@Iams4kura

Copy link
Copy Markdown

What

  • Normalize browser-generated non-breaking spaces when serializing workflow variable inputs.
  • Add a regression test covering an MCP SQL parameter with an inserted variable followed by U+00A0.

Why

VarInput copied contentEditable text nodes verbatim. Browsers can represent the space next to a non-editable variable badge as U+00A0, so the saved SQL reached the MCP database with an invalid separator and failed to parse.

How

Replace U+00A0 with an ordinary U+0020 while traversing text nodes. Variable badges, line breaks, and all other input remain on the existing serialization path.

Test

  • 本地测试通过
  • 114 测试服务器验证通过
  • Regression before: npm test -- --run src/pages/BuildPage/flow/FlowNode/component/VarInput.test.tsx exited 1 with U+00A0 preserved.
  • Regression after: the same command exited 0.
  • Smoke + affected tests: npm test -- --run src/test/smoke.test.ts src/pages/BuildPage/flow/FlowNode/component/VarInput.test.tsx
  • Production build: npm run build
  • Architecture guard: bash scripts/arch-guard.sh
  • Staged diff check: git diff --cached --check
  • Full platform suite has 14 unrelated baseline failures both before and after this patch; the patched run adds this regression as one additional passing test.

Related

Scope

  • 2 files changed, +58 / -1 lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP工具节点中写SQL 时,引入变量会存在不间断空格,导致SQL语法错误

1 participant