Route direction in Zniffer appears to be backwards
Checklist
- [x] I am not using Home Assistant. Or: a developer has told me to come here.
- [x] I have checked the troubleshooting section and my problem is not described there.
- [x] I have read the changelog and my problem is not mentioned there.
Deploy method
PKG executable
Z-Wave JS UI version
9.29.1
ZwaveJS version
14.3.7
Describe the bug
In the Zniffer pane the route direction is backwards.
To Reproduce
Make a zniffer trace.
Expected behavior
The route direction is displayed correctly.
Additional context
Here's a screenshot with a Meter Report highlighted. The route direction indicates a message from the controller (1) to the end device (64). But in reality the node has sent the message, so the direction should be 1 ← 64 or 64 → 1.
In comparison, the SiLabs Zniffer application indicates the source node as 64 and the destination as 1, without a Routed indication as it is direct.
I think the issue here is that the arrow should always be like '→' because later we sort nodeIds starting from sender to receiver based on the direction. This is the method I use:
https://github.com/zwave-js/zwave-js-ui/blob/46a9edae554f5e5b33ab4a7d1d92a583d3e50567/src/lib/utils.js#L226-L272
So making const dir = '→' should fix the issue IMO. @AlCalzone any clue? Maybe SiLabs Zniffer uses a different approach?
@kpine can you verify if only 0-hop routes have their direction wrong? The code above looks like they may.
I'm not 100% sure what the intention was, but I think I wanted "request" frames to point right, and "response" frames to point left. However that logic conflicts with the conditional position of the source and destination in the route array.
I think you are correct, I turned on a light switch remotely and here is the result:
Set/Get and Report are in the correct direction, in this case the source is on the left side.
Ok, I think this is purely a UI issue then. Let's keep both open until I've verified.
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label