DB2 : ui-event node - doesnt always generate events

Hi

My dashboard is displayed to end user via. iFrame.
Calling app sends some params as part of URL (query params)
My params are tied up to specifc user operating the dashboard - so i need to maintain the params to socket Id connection (do it via. flow context)

I am using today ui-event to detect when the user opened the page and params sent.

Observation is - ui_event gets triggered only once. While for every deployment or sometimes when the user has been away from the screen for a lot of time the socket connection breaks and new socket id comes in. No ui_event gets generated for this.
This causes a problem that now i cannot find the params connected to the user.

Is there any other smart mechanism to detect when a user came to dashboard ?
(I was relying completely on ui_event - but as explained above - it doesnt always generate events)

Hi

Just tried it, and it seems that the ui-event will only receive the lost event when the WebSocket connection is disconnected from Android.

Upon resume the tab on android, (when the popup indicating that the connection was lost and it is attempting to reconnect), the ui-control (Configured in this case to Output All Events) is the one that receives the connect event with the new socketId, the ui-event seems to only trigger with page changes not with socket reconnection...

Don't know if this is suppose to operate this way, but a quick work around would be to use also the ui-control to check for user returning to the page.

Not intentional, but also not well thought through. It's going to be covered in this issue here I think: Event handlers (in custom ui nodes) not receiving widget notifications after socket reconnect · Issue #913 · FlowFuse/node-red-dashboard · GitHub

This is what i did as well. I use the template node as i need to capture the URL params. WA exists but it means implementing some more nodes - when can be avoided.

Thanks @joepavitt

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