MQTT In and Flow Deploy, is this a bug?

#1

This was mentioned in a thread a couple of days ago bit I did not see an authoritative reply.
If the wiring out of an MQTT In node is changed (wire moved, or deleted or another one added) then a Flow deploy does not restart the MQTT node. At least retained messages are not re-sent. Is this expected behaviour? Is it desirable behaviour?

#2

I think its NodeRED consistent behaviour

If you try this out on an inject node with it set to auto-inject, then that doesn't trigger either

#3

Given that a node should not know or care what follows it, that behaviour is what I would expect.

#4

I think that is the whole point of flow level deploy though. If I have the MQTT In wired to a Function node and edit the Function node and Flow Deploy then the MQTT node does restart.

#5

Oh yes, I hadn't noticed that, so it to do with the Flow level deploy logic, not the MQTT In node.
As with the MQTT In, if I wire the inject to a function node and deploy, then edit the function node and Flow Deploy then the Inject does restart, but if the change is just to the wiring then it does not. That does not seem consistent to me.

#6

aaa - now that is a good point - the deploy button lights up but inject doesn't trigger

Actually, I've got an inject wired to a debug node and when I insert a change node in-between the two and redeploy - the inject doesn't retrigger either!! (with Deploy set to Modified Flows)

I think this might be a thing worth bringing up in its own thread

Simon

#7

No thanks... It's all the same logic. Individual nodes don't decide when they redeploy.

There was a reason a change to wiring didn't trigger a flow deploy.... I remember someone made a convincing case for it and the logic was changed. But this would have been 3-4 years ago so the specifics aren't to hand.

Happy to review the situation, and of course any highlight issues. Just not for a couple days as I'm away.

1 Like
#8

For when you come back

If I start with this

image

and add a change node

image

and then re-deploy (using Modified Flows setting), it doesn't re-trigger the inject

Its does re-trigger if I subsequently modify the change node and redeploy

#9

That doesn't seem right to me. In fact, I don't remember hitting this issue previously which really surprises me.

I've tested a number of scenarios now in a similar vein and you can certainly change the flow logic without a flow redeploy restarting the flow. If I wanted that to happen, I would use a node deploy not a flow deploy.

I guess I've always just hit the manual trigger without thinking about it. But as you say, this is much more critical with an MQTT-in node.

#10

I wouldn't go to Defcon 1 over it :slight_smile:
But it was surprising to find

#11

I'd love to revisit this if possible. I use MQTT to maintain settings that are set in the dashboard and then delivered to various parts of my flows.

It took me a while to track down why my flow logic was failing, but I eventually figured out that even with "Modified Flows" set for deploy, affected MQTT-in nodes don't consistently re-fire. This means that node-red doesn't provide my flows with the data they need from the mqtt-in nodes unless I do a full redeploy, which is excessive to do after every individual change. This behavior with "Modified flows" set doesn't seem consistent.

I haven't been able to come up with an elegant workaround that will provide my flow the data from MQTT that will persist after I press "Deploy" without manually injecting the data or doing a full redeploy.

Thanks,
Stephen

#12

For me also it is a pain that MQTT nodes do not redeploy even when Modified Flows are deployed and the MQTT node is connected to a node that has been modified. I am often having to do a Full Deploy when I would rather not. Unless that has been changed very recently.