Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
be0a41a9
authored
Apr 29, 2026
by
DigHuang
Committed by
GitHub
Apr 29, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(workflow): relax variable update reference validation to ignore stale valueType (#6859)
parent
8d67db1e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
9 deletions
+35
-9
projects/app/src/web/core/workflow/utils.ts
+7
-9
projects/app/test/web/core/app/workflow/utils.test.ts
+28
-0
No files found.
projects/app/src/web/core/workflow/utils.ts
View file @
be0a41a9
...
@@ -569,23 +569,21 @@ export const checkWorkflowNodeAndConnection = ({
...
@@ -569,23 +569,21 @@ export const checkWorkflowNodeAndConnection = ({
if
(
!
isValidReferenceValue
(
item
.
variable
,
nodeIds
)
||
!
isLiveReference
(
item
.
variable
))
if
(
!
isValidReferenceValue
(
item
.
variable
,
nodeIds
)
||
!
isLiveReference
(
item
.
variable
))
return
true
;
return
true
;
const
isArrayVar
=
typeof
item
.
valueType
===
'string'
&&
item
.
valueType
.
startsWith
(
'array'
);
if
(
item
.
renderType
===
FlowNodeInputTypeEnum
.
reference
)
{
if
(
item
.
renderType
===
FlowNodeInputTypeEnum
.
reference
)
{
if
(
isArrayVar
)
{
// 接受单引用 [ref] 与引用数组 [[ref], ...],与 dispatcher 对齐
if
(
isValidReferenceValueFormat
(
item
.
value
))
{
return
!
isLiveReference
(
item
.
value
as
ReferenceItemValueType
);
}
return
(
return
(
!
Array
.
isArray
(
item
.
value
)
||
!
Array
.
isArray
(
item
.
value
)
||
item
.
value
.
length
===
0
||
item
.
value
.
length
===
0
||
(
item
.
value
as
ReferenceItemValueType
[]).
some
((
v
)
=>
!
isLiveReference
(
v
))
(
item
.
value
as
ReferenceItemValueType
[]).
some
((
v
)
=>
!
isLiveReference
(
v
))
);
);
}
}
return
!
isLiveReference
(
item
.
value
as
ReferenceItemValueType
);
}
// input
mode: clear 不需要 value;boolean 由 booleanMode 决定
// input
模式:clear / boolean 由模式字段决定,不读 value
if
(
i
sArrayVar
&&
i
tem
.
arrayMode
===
'clear'
)
return
false
;
if
(
item
.
arrayMode
===
'clear'
)
return
false
;
if
(
item
.
valueType
===
WorkflowIOValueTypeEnum
.
boolean
)
return
false
;
if
(
item
.
booleanMode
)
return
false
;
const
inputVal
=
item
.
value
?.[
1
];
const
inputVal
=
item
.
value
?.[
1
];
return
inputVal
===
undefined
||
inputVal
===
null
||
inputVal
===
''
;
return
inputVal
===
undefined
||
inputVal
===
null
||
inputVal
===
''
;
})
})
...
...
projects/app/test/web/core/app/workflow/utils.test.ts
View file @
be0a41a9
...
@@ -528,6 +528,34 @@ describe('checkWorkflowNodeAndConnection', () => {
...
@@ -528,6 +528,34 @@ describe('checkWorkflowNodeAndConnection', () => {
).
toEqual
([
'u1'
]);
).
toEqual
([
'u1'
]);
});
});
// item.valueType 是写入快照,不与目标变量同步——校验只看 value 形态
it
(
'passes reference array form regardless of stale valueType'
,
()
=>
{
expect
(
run
([
{
variable
:
[
VARIABLE_NODE_ID
,
'foo'
],
value
:
[[
VARIABLE_NODE_ID
,
'bar'
]],
valueType
:
WorkflowIOValueTypeEnum
.
string
,
renderType
:
FlowNodeInputTypeEnum
.
reference
}
])
).
toBeUndefined
();
});
// 历史数据:array reference 旧版本存为单引用 [refNode, refOutputId]
it
(
'passes legacy single-reference form for array valueType'
,
()
=>
{
expect
(
run
([
{
variable
:
[
VARIABLE_NODE_ID
,
'foo'
],
value
:
[
VARIABLE_NODE_ID
,
'bar'
],
valueType
:
WorkflowIOValueTypeEnum
.
arrayString
,
renderType
:
FlowNodeInputTypeEnum
.
reference
}
])
).
toBeUndefined
();
});
it
(
'passes a fully filled input row'
,
()
=>
{
it
(
'passes a fully filled input row'
,
()
=>
{
expect
(
expect
(
run
([
run
([
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment