Matching node id with sub connection node id is incorrect.
When searching for a connection using findConnection
, sub-connections are checked incorrectly.
In findConnection:
String nodeIdStr(nodeId);
if (connection->subConnections.indexOf(nodeIdStr) != -1) {
The property subConnections is a json formatted string containing the sub-connection and their sub-connections.
When the node id to search for is a substring of any other node id, then the findConnection returns the wrong connection.
For example the node id = 0234, and any other node id is 1234. Because node id are stored as uint, the first id becomes "234" and matches the last 3 positions of "1234".