New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logic/17-split - join module not honoring the timeout delay #1957
Comments
Sorry for long delay getting back to you. A simple test flow like below seems to work just fine for me... nothing appears until after the timeout (in seconds)... unless I am missing something...
|
Your test flow helped me find the problem, linked to more complex messages:
So, the problem is that given the documentation, the join node set in manual mode shouldn't check the I've put an extra node to simulate the parts object in your test flow, the result is working as described : the messages are processed by the join node (manual mode) while skipping the timeout setting (increased to 5 sec).
|
I think I'm having the same issue, here is a very simple flow that reproduces the issue: [{"id":"399d6730279fee66","type":"join","z":"b50fb95c24b7db8f","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"5","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":2290,"y":820,"wires":[["5ebb448adb929ef5"]]},{"id":"5ebb448adb929ef5","type":"debug","z":"b50fb95c24b7db8f","name":"debug 27","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":2420,"y":820,"wires":[]},{"id":"23dba08dd0e12627","type":"function","z":"b50fb95c24b7db8f","name":"function 4","func":"return {\n \"payload\": \"foo\",\n \"parts\": {\n \"count\": 1\n },\n};","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2160,"y":820,"wires":[["399d6730279fee66"]]},{"id":"d726508b8cda167b","type":"inject","z":"b50fb95c24b7db8f","name":"","props":[],"repeat":"0.5","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":2030,"y":820,"wires":[["23dba08dd0e12627"]]}] Every 500 ms a message with payload Expected behavior would be one message every 5 seconds with payload Actual behavior is one message every 500 ms with payload The expected behavior can be achieved by removing the snippet |
Sorry, but WHY ON EARTH would have have a As much as a good find it may be.... |
@AndreKR can you add which versions of node-red and nodejs are you using please. If this is still present in the latest node-red then it is indeed a bug. The node should not take any notice of msg.parts when in manual mode. |
Greatest apologies. NR 3.0.2 |
It would be good to test it with the latest node red |
I was only mentioning that it would seem strange to inject repeated messages with the |
Obviously one would not intentionally do that, but the message might have a parts property from a previous node. The flow is a test flow only. |
@Just-another-pleb In this test flow it is there to demonstrate the issue obviously. In the real flow it's because it comes from a split node. I have a device that sends a combined status update as a JSON array and I split it up and only process some parts of it. @colinl I'm using the Docker image |
I can also confirm seeing the problem with the test flow and node red 3.1.0, with nodejs 20.5.1. |
@dceejay would you consider removing the |
The obvious fix is for us to remove the parts property if we are in manual mode. But need to be careful a) that we aren't using it for something even if we shouldn't be. IE that deleting doesn't break existing and b) do need to preserve msg.parts.parts. IE we do stack recurring splits and mustn't break that. |
What are the steps to reproduce?
I've set the join module right after the template module (mustache mode, output as text) to have in a single string in a message the result of multiple messages
The join module is set to :
What happens?
If I set
After a number of message parts
to a number, I'll get a single message as expected after the amount of message set was received, with the payload combining all those received message payload.But, as the number of received messages can varies, using a timeout is more suited.
Problem is, if using only
After a timeout following the first message
, any number set will always result with all received message immediately transmitted, without any joining done.Even if the number is assumed in ms (which seems to be in sec), setting a timeout of 10000 will still result to each received message transmitted in the next ms.
What do you expect to happen?
According to the timeout value set, a single message XX sec after the first received by join, containing the payload of multiple messages.
Please tell us about your environment:
The text was updated successfully, but these errors were encountered: