fix: Variable Assigner node silently fails for legacy V1 data format (#28867)

This commit is contained in:
kinglisky
2025-12-05 15:27:18 +08:00
committed by GitHub
parent c2cf0a98bb
commit 02fdc5e2a4
3 changed files with 29 additions and 8 deletions

View File

@@ -30,7 +30,13 @@ def test_overwrite_string_variable():
"nodes": [
{"data": {"type": "start", "title": "Start"}, "id": "start"},
{
"data": {"type": "assigner", "version": "1", "title": "Variable Assigner", "items": []},
"data": {
"type": "assigner",
"title": "Variable Assigner",
"assigned_variable_selector": ["conversation", "test_conversation_variable"],
"write_mode": "over-write",
"input_variable_selector": ["node_id", "test_string_variable"],
},
"id": "assigner",
},
],
@@ -131,7 +137,13 @@ def test_append_variable_to_array():
"nodes": [
{"data": {"type": "start", "title": "Start"}, "id": "start"},
{
"data": {"type": "assigner", "version": "1", "title": "Variable Assigner", "items": []},
"data": {
"type": "assigner",
"title": "Variable Assigner",
"assigned_variable_selector": ["conversation", "test_conversation_variable"],
"write_mode": "append",
"input_variable_selector": ["node_id", "test_string_variable"],
},
"id": "assigner",
},
],
@@ -231,7 +243,13 @@ def test_clear_array():
"nodes": [
{"data": {"type": "start", "title": "Start"}, "id": "start"},
{
"data": {"type": "assigner", "version": "1", "title": "Variable Assigner", "items": []},
"data": {
"type": "assigner",
"title": "Variable Assigner",
"assigned_variable_selector": ["conversation", "test_conversation_variable"],
"write_mode": "clear",
"input_variable_selector": [],
},
"id": "assigner",
},
],

View File

@@ -78,7 +78,7 @@ def test_remove_first_from_array():
"nodes": [
{"data": {"type": "start", "title": "Start"}, "id": "start"},
{
"data": {"type": "assigner", "title": "Variable Assigner", "items": []},
"data": {"type": "assigner", "version": "2", "title": "Variable Assigner", "items": []},
"id": "assigner",
},
],
@@ -162,7 +162,7 @@ def test_remove_last_from_array():
"nodes": [
{"data": {"type": "start", "title": "Start"}, "id": "start"},
{
"data": {"type": "assigner", "title": "Variable Assigner", "items": []},
"data": {"type": "assigner", "version": "2", "title": "Variable Assigner", "items": []},
"id": "assigner",
},
],
@@ -243,7 +243,7 @@ def test_remove_first_from_empty_array():
"nodes": [
{"data": {"type": "start", "title": "Start"}, "id": "start"},
{
"data": {"type": "assigner", "title": "Variable Assigner", "items": []},
"data": {"type": "assigner", "version": "2", "title": "Variable Assigner", "items": []},
"id": "assigner",
},
],
@@ -324,7 +324,7 @@ def test_remove_last_from_empty_array():
"nodes": [
{"data": {"type": "start", "title": "Start"}, "id": "start"},
{
"data": {"type": "assigner", "title": "Variable Assigner", "items": []},
"data": {"type": "assigner", "version": "2", "title": "Variable Assigner", "items": []},
"id": "assigner",
},
],