Possible bug ( UI dashboard switch node or function switch Node)

Hi all,
doing a fairly simple display control for a PTZ camera, anyway i was getting multiple instances of switch toggles, so i copied the offending items to another flow just to see what was happening.
i added another switch to the same switch node that i was already using and it worked fine , but if i clicked the original one i got double switching e.g true true.
So i tried to delete the link between the old switch ui and the switch node and it highlighted orange, pressed delete and it was still there!
re deployed and it still switched, tried to delete the link and this time it went.
so it looks like there are 2 links connecting to the switch node. tried it a few time just to see if it was me but it did the same thing!
Node Red 2.2.0
NPM 6.14.16
Node 14.19.0
Linux Mint
offending item is below

[
    {
        "id": "722804950b4b4251",
        "type": "switch",
        "z": "77f64d9d09139432",
        "name": "Mode",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "true"
            },
            {
                "t": "false"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 730,
        "y": 220,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "e6f5d2c9e6d468c2",
        "type": "debug",
        "z": "77f64d9d09139432",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 710,
        "y": 180,
        "wires": []
    },
    {
        "id": "aad3e59254f825af",
        "type": "ui_switch",
        "z": "77f64d9d09139432",
        "name": "",
        "label": "Thermo Enable",
        "tooltip": "",
        "group": "e95113d77e51b515",
        "order": 1,
        "width": 0,
        "height": 0,
        "passthru": true,
        "decouple": "false",
        "topic": "topic",
        "topicType": "msg",
        "style": "",
        "onvalue": "true",
        "onvalueType": "bool",
        "onicon": "fa-power-off fa-2x",
        "oncolor": "green",
        "offvalue": "false",
        "offvalueType": "bool",
        "officon": "fa-power-off fa-2x",
        "offcolor": "grey",
        "animate": true,
        "className": "",
        "x": 420,
        "y": 220,
        "wires": [
            [
                "722804950b4b4251",
                "722804950b4b4251",
                "e6f5d2c9e6d468c2"
            ]
        ]
    },
    {
        "id": "e95113d77e51b515",
        "type": "ui_group",
        "name": "Thermal Mode",
        "tab": "2bf55b350517e8d4",
        "order": 2,
        "disp": true,
        "width": 6,
        "collapse": false,
        "className": ""
    },
    {
        "id": "2bf55b350517e8d4",
        "type": "ui_tab",
        "name": "PTZ",
        "icon": "camera",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

I can't edit your posts, but you didn't post the code correctly.

You need to use the button that looks like this: </> to paste code.
Otherwise it doesn't work properly.

1 Like

You need to select the nodes you want to share and use the menu export command to export to clipboard and paste it here.

1 Like

ok updated previous post

I have imported your flow, can you describe what I have to do to see the problem?

[Edit] Oh yes, I see what you mean. Deleting the wire between the ui switch and the Switch nodes leaves the wire there the first time, and then you can't select it again.

Looking at the exported flow, there are two wires from the ui switch to the Switch. How the system could get into this state I don't know, and what is the best way to get out of it I don't know. Perhaps delete those nodes and recreate them.

I think this may need someone like @knolleary to look at it.

@Colin Yeah that's the problem, if you delete the first one the second one isn't select able until you refresh the screen then you can delete it.
i couldn't directly reproduce it after, had to copy that one over.
Phew thought it was just me lol.

if you look at the json data i posted it actually shows up a duplicate wire name

1 Like

Yes, I said that.

I could not understand the issue for quite sometime,

There appears to be only one connection between UI Switch and Switch Node,
but when you introduce another node in between, there appears another 'hidden' wire, which you cannot 'select' but disappears when ui switch node is deleted.

wire

Infact, there seems to be infinite wires hidden there :astonished:
wire1

There are only two, as you saw from the export, but I guess the software is confused by that illegal condition.
Have you any idea how you got to that state?

@Colin. No idea just dropped a ui switch and a switch node then linked them. Had me chasing my tail for hours. Didn't drag anything in between at any point.
Done a few more tests and can't reproduce it again.

For the record, what browser are you using?

@vikingsraven there has been another reported case which looks similar to yours

I have submitted an issue on github so the developers will see it. Could you subscribe that the issue so you can answer any questions the developers may have, please?

I could replicate the error and i use Google Chrome with latest update

image

Could you add that to the github issue please, including how to replicate it.

sorry, i meant i could 'see' the problem after copying and deploying the flow provided by @vikingsraven. I could not replicate the issue on my own from scratch.

@smanjunath211 I presume you do mean that you are able to create the situation with duplicated wires, not just that you see the wire delete problem once you have duplicate wires. The wire delete problem is not a significant issue as it should not be possible to get into that situation in the first place.

Yes, i am unable to create the situation where 2 wires are shown simultaneously connected between 2 nodes.