Currently I am using post to upload a excel file , and I will use ajax to get this response.
and the next step is reading the excel header into a smart-select such as
but the problem is if the excel have 100-200 rows (test data) it will work fine.
but for the real data usually have 1,000 - 5,000 rows and my dev console will return
[uibuilderfe:socket-disconnect] Reason: transport close
and nothing error in node-red debug option.
May I know how do I fix this or any suggestions to increase my flow?
The command you are showing is sending from uibuilderfe to Node-RED, is that where the error is?
Also, you are manually adding the _socketId - are you sure that the id you are adding matches the client's current id? The id does change if your browser has any network issues and so temporarily looses connection.
Other than that, I suspect that you are trying to send too large a message. I've never actually done any message size testing with Socket.IO (which is what uibuilder uses for its websocket connections).
My guess would be that either the network connection between your browser and the Node-RED Server is a little slow and so the request times out before it is finished or there is some inherent limit in a websocket message.
Possibly reviewing the websocket exchanges in your browser dev tools network tab might shed some light.
Maybe test the length of the payload before sending and split it into chunks if needed.
I see that there is a potential work-around but it requires a configuration option setting in Socket.IO on setup. That is one of the things on my backlog to allow in uibuilder.
That is normal. What happens with websockets is that an http connection is made initially and once the handshake as completed, the connection is "upgraded" from http to ws. In the network list, you will then see a connection with a status of 101 which is the open connection. This will then hopefully stay open as long as that tab is connected.
If you click on that line, you should be able to see the ongoing comms between the client and the server.
Alright, so what I need to do right now is split the data before send to UI builder, and after process the data in node red I receive it back to append the table.
you could, as a test, add maxHttpBufferSize: 1e8 in socket server options
change .node-red\node_modules\node-red-contrib-uibuilder\nodes\libs\socket.js
Lines 130
let ioOptions = {
'path': uib_socketPath,
"maxHttpBufferSize": 1e8
save, restart NR and test it so @TotallyInformation can have some feedback whether its a feature worth adding in uibuilder.
You do have a computer to hand - so it won't be tedious, that's what computers are for!
As mentioned, already was on the backlog to be able to change socket.io config. Not all that high up the backlog admitedly but now bumped up some, for sure. It will be up to people to change the config themselves though as, for most people, they wont need it.
If I can. I'll try to squeeze this into the v5 release currently being worked on.
hehe .. i know .. i was thinking about the small complexity of unnecessary code, to have to slice the array of data and send it piece by piece and then in the front end do the reverse to append it to whatever table its gonna be presented on. when it could be as simple as increasing the bufferSize (hard coded)
ps. i read you other post of the new uibuilder changes. excellent work!!
nice .. glad it worked for you because i tried to test it also by sending a 7mb string as a payload but i couldnt replicate the error.
anyway .. keep in mind that when you update uibuilder node to a newer version you'll lose that change
i later noticed that in most of your code screenshots you use the onChange msgsReceived event that passes in newVal. Based on the documenation newVal here will be a counter / integer ?
In order to get the actual msg from NR, shouldn't that be :
uibuilder.onChange('msg', function(msg){
console.info('msg received from Node-RED server:', msg)
})