Sending a mix of string and buffer payloads into a streaming split node results in what appears to be incorrect triggering of Complete nodes.
A Complete node should only be triggered for a message after it has been processed. In the case of a Split node, processed means that the input data has been fully output. In the current implementation, it is possible to receive a Complete trigger before the received data is output by the Split node.
Use the flow below to see the problem. The (condensed) output is
Output 1 is unexpected as string "aa" hasn't been output until step 6.
[
{
"id": "f1ef99ae46e3ab85",
"type": "tab",
"label": "split3-bug",
"disabled": false,
"info": "",
"env": []
},
{
"id": "a5fa4b17fa90dabf",
"type": "inject",
"z": "f1ef99ae46e3ab85",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "aa",
"payloadType": "str",
"x": 230,
"y": 120,
"wires": [
[
"576112f164d45ffb"
]
]
},
{
"id": "0241766cbc77206f",
"type": "inject",
"z": "f1ef99ae46e3ab85",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "0.2",
"topic": "",
"payload": "[97,33,98,33,99,33]",
"payloadType": "bin",
"x": 230,
"y": 180,
"wires": [
[
"576112f164d45ffb"
]
]
},
{
"id": "584b48ac74ca1817",
"type": "inject",
"z": "f1ef99ae46e3ab85",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "0.3",
"topic": "",
"payload": "!bb",
"payloadType": "str",
"x": 230,
"y": 240,
"wires": [
[
"576112f164d45ffb"
]
]
},
{
"id": "576112f164d45ffb",
"type": "split",
"z": "f1ef99ae46e3ab85",
"name": "",
"splt": "!",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": true,
"addname": "",
"x": 430,
"y": 180,
"wires": [
[
"9609730e293aa48b"
]
]
},
{
"id": "9609730e293aa48b",
"type": "debug",
"z": "f1ef99ae46e3ab85",
"name": "debug 10",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 620,
"y": 180,
"wires": []
},
{
"id": "f8ee960240d9a9f1",
"type": "complete",
"z": "f1ef99ae46e3ab85",
"name": "",
"scope": [
"576112f164d45ffb"
],
"uncaught": false,
"x": 230,
"y": 320,
"wires": [
[
"4d5e8d6671f55485"
]
]
},
{
"id": "4d5e8d6671f55485",
"type": "change",
"z": "f1ef99ae46e3ab85",
"name": "",
"rules": [
{
"t": "set",
"p": "DONE",
"pt": "msg",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 420,
"y": 320,
"wires": [
[
"9609730e293aa48b"
]
]
}
]
Current Behavior
Sending a mix of string and buffer payloads into a streaming split node results in what appears to be incorrect triggering of Complete nodes.
Expected Behavior
A Complete node should only be triggered for a message after it has been processed. In the case of a Split node, processed means that the input data has been fully output. In the current implementation, it is possible to receive a Complete trigger before the received data is output by the Split node.
Steps To Reproduce
Use the flow below to see the problem. The (condensed) output is
Output 1 is unexpected as string "aa" hasn't been output until step 6.
The expected output is:
Example flow
[ { "id": "f1ef99ae46e3ab85", "type": "tab", "label": "split3-bug", "disabled": false, "info": "", "env": [] }, { "id": "a5fa4b17fa90dabf", "type": "inject", "z": "f1ef99ae46e3ab85", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "aa", "payloadType": "str", "x": 230, "y": 120, "wires": [ [ "576112f164d45ffb" ] ] }, { "id": "0241766cbc77206f", "type": "inject", "z": "f1ef99ae46e3ab85", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.2", "topic": "", "payload": "[97,33,98,33,99,33]", "payloadType": "bin", "x": 230, "y": 180, "wires": [ [ "576112f164d45ffb" ] ] }, { "id": "584b48ac74ca1817", "type": "inject", "z": "f1ef99ae46e3ab85", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "0.3", "topic": "", "payload": "!bb", "payloadType": "str", "x": 230, "y": 240, "wires": [ [ "576112f164d45ffb" ] ] }, { "id": "576112f164d45ffb", "type": "split", "z": "f1ef99ae46e3ab85", "name": "", "splt": "!", "spltType": "str", "arraySplt": 1, "arraySpltType": "len", "stream": true, "addname": "", "x": 430, "y": 180, "wires": [ [ "9609730e293aa48b" ] ] }, { "id": "9609730e293aa48b", "type": "debug", "z": "f1ef99ae46e3ab85", "name": "debug 10", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 620, "y": 180, "wires": [] }, { "id": "f8ee960240d9a9f1", "type": "complete", "z": "f1ef99ae46e3ab85", "name": "", "scope": [ "576112f164d45ffb" ], "uncaught": false, "x": 230, "y": 320, "wires": [ [ "4d5e8d6671f55485" ] ] }, { "id": "4d5e8d6671f55485", "type": "change", "z": "f1ef99ae46e3ab85", "name": "", "rules": [ { "t": "set", "p": "DONE", "pt": "msg", "to": "true", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 420, "y": 320, "wires": [ [ "9609730e293aa48b" ] ] } ]Environment