The *new* (updatd) `ping` node

I have just had a world of hurt when I installed/updated the standard ping node.

I was using theadvanced-ping node but it is kind of deprecated.

I started modifying my flows to use the standard ping node and things weren't working as expected.

What??!!*

Hmmm.... thinking and looking more closely at the messages.

ARGH!

The ping node strips away any extra stuff on a message.

So if I am sending something like:

{"name":"test","payload":"192.168.0.1"}

The name isn't getting through.

So it is one step forward, one backward.

Probably petty of me, but this seems to not be helping how the node works if it strips away unused parts of the message.

Could it be modified to leave any extra parts of the message intact?

It appears you are right, the ping node does not keep additional properties in the input message. I think that counts as a bug in node-red-node-ping so I suggest you submit an issue.

1 Like

Well, I am not sure it is an "issue" and more me wanting....

I did post to the feature request part.

The (excuse) for the way ping works is backwards compatability.

Before I added Triggered mode to the ping node, it was purely a sender (no input) but I realised that folk would need info downstream to correlate what they sent. Additionally, as it is a completely async operation & more than 1 item can be pinged, it was decided to pass the original payload in msg.ping so the user could access the extra meta data.

Potentially, I could have held onto and resent clones the original msg for each ping result in the CSV/Array, but this didnt feel right at the time of writing the PR.

@dceejay any opinion on this please?

Hmm yes - Can't think why we didn't pass through the original properties. As you say - originally it was just a generator node so there would never be any expectation of additional data. It would make sense if it was consistent with other nodes and did pass through if possible, as having to create an array and add extradata is a bit of a faff for simple use cases.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.