Change tab / hide groups affects all sessions

Hi All,

I have a tab which is quite busy and lags on tablets etc. To improve performance I decided to create a menu on another tab. This first hides all groups on the second tab then shows only the one relevant to the button and then changes tab.

I am "quite" sure this worked OK at some point, but I have updated some nodes and dashboard recently ?

In any case the functionality works, but now all active browsers are switching to the second tab, and the groups are hidden on all browsers.

Bellow you can see that when I press a button on socketid: "WtsdbIWnpHflL2RtAAAn" ( this is shown correctly in the address bar) the hide, show and change messages are sent to UI-control node with correct socketid.

But then you can also see 3 browser sessions all change at once.
More odd is the fact the socketids of these 3 messages are NOT the ones shown in address bars.

Any suggestions for trouble shooting would be greatly appreciated, as its got me scratching my head now. :wink:

02/11/2021, 01:42:34 node: e269dd79564cf988
Landing : msg : Object
object
payload: object
group: object
hide: array[10]
topic: "Landing"
event: object
socketid: "WtsdbIWnpHflL2RtAAAn"
_msgid: "da2ae69bbc928e08"
02/11/2021, 01:42:34 node: e269dd79564cf988
Landing : msg : Object
object
payload: object
group: object
show: array[1]
topic: "Landing"
event: object
socketid: "WtsdbIWnpHflL2RtAAAn"
_msgid: "da2ae69bbc928e08"
02/11/2021, 01:42:34 node: e269dd79564cf988
Landing : msg : Object
object
payload: "Controls"
topic: "Landing"
event: object
socketid: "WtsdbIWnpHflL2RtAAAn"
_msgid: "da2ae69bbc928e08"
02/11/2021, 01:42:35 node: 3b666e22d35b71a7 msg : Object
{ payload: "change", tab: "3", name: "Controls", socketid: "5janpFxQIY_wUR3cAAAm", socketip: "192.168.1.101" … }
02/11/2021, 01:42:35 node: 3b666e22d35b71a7 msg : Object
{ payload: "change", tab: "3", name: "Controls", socketid: "KBwcSNW9ZzbOkmOxAAAk", socketip: "192.168.1.101" … }
02/11/2021, 01:42:35 node: 3b666e22d35b71a7 msg : Object
{ payload: "change", tab: "3", name: "Controls", socketid: "IkkfQjxW6JfgbEtbAAAg", socketip: "192.168.1.204" … }

Hi all,

To try and narrow the problem I just replaced all uicontrol nodes with links to just one uicontrol node with debug on in and out, to see if there were any odd messages.

I still cannot understand what is happening here ?

Trying to change tab on one session chages them all and shows WRONG socketids

03/11/2021, 15:53:36 node: ui IN
home : msg : Object
object
payload: "0"
topic: "home"
socketid: "9D89ewRO29IpkO78AAMf"
_msgid: "1746aa9f767c9228"
_event: "node:6bfe4d0f48cfbea4"

03/11/2021, 15:53:36 node: ui OUT
msg : Object
object
payload: "change"
tab: 0
name: "Home Page"
socketid: "evTV-VaUwuJOlq5dAAMe"
socketip: "192.168.1.101"
params: object
_msgid: "bfb0eb384496bd1c"

03/11/2021, 15:53:36 node: ui OUT
msg : Object
object
payload: "change"
tab: 0
name: "Home Page"
socketid: "ieUSDnjl6nGzdoXsAANs"
socketip: "192.168.1.204"
params: object
_msgid: "57679473d14f41bd"

@dceejay Could you please take a look at my issue when you get a chance. I don't know if I'm doing something wrong or there is a bug ?

I cannot see it being the latter as I'm sure it would have been seen by others, the only thing I could see on github issues was ui_control #731, but my problem is different.

Thanks

Node Red 2.0.5
Dashboard 3.1.0

Do you have a sample flow that shows this problem we can play with ?

Try this - it shows same fault for me ...

 [{"id":"38adb55401dd5644","type":"ui_ui_control","z":"0247c3b12b5aaf3c","name":"","events":"all","x":1440,"y":480,"wires":[["4a08a56d7819f99b"]]},{"id":"3bd15aefeb899411","type":"function","z":"0247c3b12b5aaf3c","name":"","func":"msg.payload = {\n    \"group\": {\n        \"hide\": [\n            \"test_one\",\n            \"test_two\",\n            \"test_three\",\n           \n        ]\n    }\n}\n\nnode.send(msg);\n\nmsg.payload = {\n    \"group\": {\n        \"show\": [\n            \"test_\"+ msg.topic\n        ]\n    }\n}\n\nnode.send(msg);\n\nmsg.payload = \"test\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1260,"y":400,"wires":[["e9a2f7e7e8c809d3","38adb55401dd5644"]]},{"id":"f69918df629bed9e","type":"ui_button","z":"0247c3b12b5aaf3c","name":"one","group":"712a65f94edeb028","order":1,"width":"0","height":"0","passthru":false,"label":"one","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"one","topicType":"str","x":1010,"y":360,"wires":[["3bd15aefeb899411"]]},{"id":"6e9b47faaba8dc92","type":"ui_button","z":"0247c3b12b5aaf3c","name":"three","group":"712a65f94edeb028","order":3,"width":"0","height":"0","passthru":false,"label":"three","tooltip":"","color":"","bgcolor":"#009999","className":"","icon":"","payload":"","payloadType":"str","topic":"three","topicType":"str","x":1010,"y":440,"wires":[["3bd15aefeb899411"]]},{"id":"200b93d80f0aea3c","type":"ui_button","z":"0247c3b12b5aaf3c","name":"two","group":"712a65f94edeb028","order":2,"width":"0","height":"0","passthru":false,"label":"two","tooltip":"","color":"","bgcolor":"#009999","className":"","icon":"","payload":"","payloadType":"str","topic":"two","topicType":"str","x":1010,"y":400,"wires":[["3bd15aefeb899411"]]},{"id":"e9a2f7e7e8c809d3","type":"debug","z":"0247c3b12b5aaf3c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1430,"y":400,"wires":[]},{"id":"4a08a56d7819f99b","type":"debug","z":"0247c3b12b5aaf3c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1610,"y":480,"wires":[]},{"id":"430a39bd9af2b4a4","type":"ui_button","z":"0247c3b12b5aaf3c","name":"one","group":"d8d969a72f9d0dac","order":2,"width":"0","height":"0","passthru":false,"label":"home one","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"anothertab","payloadType":"str","topic":"","topicType":"str","x":1010,"y":520,"wires":[["38adb55401dd5644"]]},{"id":"720430351836788b","type":"ui_button","z":"0247c3b12b5aaf3c","name":"three","group":"fecf6b2c463620c5","order":2,"width":"0","height":"0","passthru":false,"label":"home  three","tooltip":"","color":"","bgcolor":"#009999","className":"","icon":"","payload":"anothertab","payloadType":"str","topic":"","topicType":"str","x":1010,"y":600,"wires":[["38adb55401dd5644"]]},{"id":"95c317fe8af68b55","type":"ui_button","z":"0247c3b12b5aaf3c","name":"two","group":"abb5a0efe0692c1e","order":2,"width":"0","height":"0","passthru":false,"label":"home two","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"anothertab","payloadType":"str","topic":"","topicType":"str","x":1010,"y":560,"wires":[["38adb55401dd5644"]]},{"id":"712a65f94edeb028","type":"ui_group","name":"buttons","tab":"d9f0e7b0f4a32e9a","order":15,"disp":true,"width":"6","collapse":false,"className":""},{"id":"d8d969a72f9d0dac","type":"ui_group","name":"one","tab":"23a651b6a6ca37ba","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"fecf6b2c463620c5","type":"ui_group","name":"three","tab":"23a651b6a6ca37ba","order":3,"disp":true,"width":"6","collapse":false,"className":""},{"id":"abb5a0efe0692c1e","type":"ui_group","name":"two","tab":"23a651b6a6ca37ba","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"d9f0e7b0f4a32e9a","type":"ui_tab","name":"anothertab","icon":"dashboard","disabled":false,"hidden":false},{"id":"23a651b6a6ca37ba","type":"ui_tab","name":"test","icon":"dashboard","disabled":false,"hidden":false}]

I see there is a newer version of node-red, should I upgrade and test again ?

I think it is a good idea to upgrade and test again. I am running different versions and it is working nicely. Opening different browser tabs (Chrome) and they are working without impacting others.

Node-RED : 2.1.0 - beta.2
Dashboard: 3.0.4
Windows 10 - Chrome

PS: After upgrading the dashboard to the latest version I could reproduce the issue you mentioned. I did a testing by opening three browser tabs.

So, my conclusion is that the ui_control node behaves differently from dashboard version 3.0.4 to version 3.1.0.

Version 3.0.4
The ui_control node will receive three messages from the function node but will output only one to the connected debug node (updating only one browser tab).

Version 3.1.0
The ui_control node receives three messages from the function node and output three messages (one for each browser session opened).

I was expecting a behaviour like explained in below post:

Aha - thanks for digging into this... Yes my bad... I removed a check in response to this ui_control node does not switch tabs in response to a ui_control · Issue #731 · node-red/node-red-dashboard · GitHub - and I couldn't recall why the check was there... and of course this was it... so I will revert this change in 3.1.1 shortly.

2 Likes

Thanks - Let me know and I will test the fix.

Thanks - That seems to be working again now, just needed to clear web cache for it to take effect.

1 Like

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