Uibuilder websocket performance issue

I have noticed that my uibuilder webpage sometimes takes a really long time to refresh. Usually it refreshes within a second, but it then reverts to 10+ seconds after some time in use.

In the network tab of the console I can see a websocket that keeps increasing in time. It may have nothing to do with the lag, but I don't really understand the back-end at all, so thought it might indicate the nature of the issue...

In the Console this is what I'm seeing....

When I hit refresh I see this as it's trying to connect

I think that you will need to turn on debug for the front-end. Which version of uibuilder are you using?

I think you are using the non-minimised version of the front-end library? This will be slightly slower than the minimised version but isn't the cause of what you are seeing there.

There is something very odd about that network chart. Why are the same resources being loaded multiple times? Also, I'm not sure what the "Initiator" column is showing things like websocket.js since that isn't used (at least directly) by Socket.IO which is what uibuilder uses.

Here is an image of one of my test pages:

Very different to what you are seeing. I think that you will need to share your html and js files.

Something appears to be killing your websocket connection.

Is there a chance that as I'm developing code, and making mistakes along the way, that it's causing the issue...?

Problem is that I can't reliably cause the issue to reoccur.

For example, I haven't seen it once today.

How can I share the files, other than github?

Yes :slight_smile:

You can paste them here if they aren't enormous. You could also use a Gist if you didn't want to use a full repo.

The files are big.

I appreciate the offer to help but I need to isolate the issue first otherwise it will be a waste of your time..

I'll get back with a more specific question (and the code, if required) when i know which part of the code is causing it.

First place to look is at whether you are loading any other libraries in your HTML to see if there is something clashing.

The interesting thing is that it still hasn't happened today, so I am starting to think that it was something to do with my code at the time.

I'm not loading any new libraries since a very long time ago, so that can't be the cause.
I have loaded components (of course), as that's the fun of using Parcel to compile :wink:

I'll keep an eagle eye on it, perhaps :crossed_fingers: it will never come back again.

It tell you one thing, I bit off quite a bit getting audio fully functional in the floorplan. I still have some way to go before it's "production" ready...

On the face of it, it looks like its working, but there is quite some back-end work I want to do to make it "child" proof :slight_smile:

FYI, I'm going to rebuild the playlist shortcuts to probably use drop downs, so I can include more of my collection .... you can see since I've had kids, that I appreciate "chilling" a lot more these days... haha!

2 Likes

I have found out what the issue most likely was. I had a 2nd web page open on another PC whilst I was developing on my main PC and I came across an inexplicable bug.. Spent hours debugging it with the help of @unborn, in the end I want to say that it clicked that I should refresh the “other” web page, but in reality I was at a loss for what else to do… I’d tried everything you can imagine from restarting flows, restarting node-red, rebooting the pc, clearing the browser cache, trawling through my code over and over again, commenting parts out, you get the idea. In the end, lesson learnt.