While upgrading from Node-RED 3.x to Node-RED 4.x we've stumbled upon an annoying issue:
We were using a status node to track the connection state of a TCP request node but the status.text changed in Node-RED 4 and our comparison started failing.
We fixed it for now by checking if the fill
property is green but that seems a bit hackish. Would it make sense to allow node.status to pass additional properties that would be independent from the text displayed in the editor ? That would seem more reliable to check things like connections etc.
Do you have the text of your v3.x?
I have the following text for v4: "node-red:common.status.connecting"
for connecting state.
So the field in Node-RED 4 is tcpin.status.connections
and the content of the string is n connections
where n
is the number of connections.
We could check that but it seems a bit dangerous as the format could change and it's also not the same string depending on localization.
Ok I see, this message is translated in the runtime and therefore depends on the runtime language. I don't think it's an error that the runtime language might be different from the editor language. But this implies that all these messages intended for the editor will have the language of the runtime. Quid?
Regarding your question here, I don't know what could have changed between the two versions.
This is what changed:
That's fine, I think it's legit for the status text to change between versions, what I'm wondering is if it would make sense to allow passing additional variables to node.status that could be parsed more easily than text.
The message only gets translated for display, so should remain constant across languages on the runtime side, but yes that message did change across versions in order to improve the feedback to the user (hopefully)
I’m not sure adding another property would help much as we may need to change that also for some reason to match or add functionality if we modify the status reported.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.